From: Erik Edelmann Date: Sat, 18 Jun 2005 18:16:22 +0000 (+0000) Subject: re PR fortran/19926 ([4.0 only] Incorrect rank with PARAMETER and array element.) X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b7263e8f2f6085de756c1f9ce479e94d731d972c;p=platform%2Fupstream%2Fgcc.git re PR fortran/19926 ([4.0 only] Incorrect rank with PARAMETER and array element.) PR fortran/19926 * primary.c (gfc_match_rvalue): expr_type can be EXPR_CONSTANT for an array; check that sym->as is NULL. Co-Authored-By: Steven G. Kargl From-SVN: r101161 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 0b3d117..1d180a2 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,11 @@ +2005-06-18 Erik Edelman + Steven G. Kargl + + PR fortran/19926 + * primary.c (gfc_match_rvalue): expr_type can be EXPR_CONSTANT + for an array; check that sym->as is NULL. + + 2005-06-18 Steven G. Kargl * intrinsic.c (gfc_intrinsic_func_interface): Enable errors for generic diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index 38f9939..e1acfbf 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -1802,8 +1802,11 @@ gfc_match_rvalue (gfc_expr ** result) break; case FL_PARAMETER: - if (sym->value - && sym->value->expr_type != EXPR_ARRAY) + /* A statement of the form "REAL, parameter :: a(0:10) = 1" will + end up here. Unfortunately, sym->value->expr_type is set to + EXPR_CONSTANT, and so the if () branch would be followed without + the !sym->as check. */ + if (sym->value && sym->value->expr_type != EXPR_ARRAY && !sym->as) e = gfc_copy_expr (sym->value); else {