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
This commit is contained in:
Erik Edelmann 2006-10-24 17:01:30 +00:00
parent 6d4d216add
commit b9703d9852
4 changed files with 20 additions and 0 deletions

View File

@ -1,3 +1,9 @@
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>
* Make-lang.in (f951$(exeext)): Depend on and link with attribs.o.

View File

@ -1363,6 +1363,8 @@ simplify_parameter_variable (gfc_expr * p, int type)
if (e == NULL)
return FAILURE;
e->rank = p->rank;
/* Do not copy subobject refs for constant. */
if (e->expr_type != EXPR_CONSTANT && p->ref != NULL)
e->ref = copy_ref (p->ref);

View File

@ -1,3 +1,8 @@
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>
* gcc.dg/torture/builtin-math-2.c: New test.

View File

@ -0,0 +1,7 @@
! { 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