Commit b9703d98 by Erik Edelmann

re PR fortran/29393 (Vector subscript rejected)

fortran/
2006-10-24  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/29393
        * expr.c (simplify_parameter_variable): Keep rank of original
         expression.

Testsuite/
2006-10-24  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/29393
        * gfortran.dg/initialize_2.f90: New.

From-SVN: r118008
parent 6d4d216a
2006-10-24 Erik Edelmann <eedelman@gcc.gnu.org>
PR fortran/29393
* expr.c (simplify_parameter_variable): Keep rank of original
expression.
2006-10-23 Rafael Avila de Espindola <rafael.espindola@gmail.com> 2006-10-23 Rafael Avila de Espindola <rafael.espindola@gmail.com>
* Make-lang.in (f951$(exeext)): Depend on and link with attribs.o. * Make-lang.in (f951$(exeext)): Depend on and link with attribs.o.
......
...@@ -1363,6 +1363,8 @@ simplify_parameter_variable (gfc_expr * p, int type) ...@@ -1363,6 +1363,8 @@ simplify_parameter_variable (gfc_expr * p, int type)
if (e == NULL) if (e == NULL)
return FAILURE; return FAILURE;
e->rank = p->rank;
/* Do not copy subobject refs for constant. */ /* Do not copy subobject refs for constant. */
if (e->expr_type != EXPR_CONSTANT && p->ref != NULL) if (e->expr_type != EXPR_CONSTANT && p->ref != NULL)
e->ref = copy_ref (p->ref); e->ref = copy_ref (p->ref);
......
2006-10-24 Erik Edelmann <eedelman@gcc.gnu.org>
PR fortran/29393
* gfortran.dg/initialize_2.f90: New.
2006-10-24 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2006-10-24 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.dg/torture/builtin-math-2.c: New test. * gcc.dg/torture/builtin-math-2.c: New test.
! { dg-do compile }
! PR 29393: Ranks of PARAMETER-lhs in initializations
integer, parameter :: A(-3:7,2)=0
integer, parameter, dimension(3) :: V = (/ 2, 4, 6 /)
integer, parameter, dimension(3) :: B = A(V,1)
integer, parameter, dimension(3) :: C = A(0:2,1)
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment