diff options
author | Daniel Franke <franke.daniel@gmail.com> | 2010-05-13 10:08:05 -0400 |
---|---|---|
committer | Daniel Franke <dfranke@gcc.gnu.org> | 2010-05-13 10:08:05 -0400 |
commit | f2cbd86c34ffc36a36090944d18b86985b22442d (patch) | |
tree | c4f84c65f11ace6d3113c31c9459bee24b509b97 /gcc/fortran/expr.c | |
parent | 917ed77360cf86ddf2b45851187f532c137d77d0 (diff) | |
download | gcc-f2cbd86c34ffc36a36090944d18b86985b22442d.zip gcc-f2cbd86c34ffc36a36090944d18b86985b22442d.tar.gz gcc-f2cbd86c34ffc36a36090944d18b86985b22442d.tar.bz2 |
re PR fortran/35779 (error pointer wrong in PARAMETER)
gcc/fortran/:
2010-05-13 Daniel Franke <franke.daniel@gmail.com>
PR fortran/35779
* intrinsic.c (gfc_init_expr): Renamed to gfc_init_expr_flag.
Updated all usages.
* expr.c (init_flag): Removed; use gfc_init_expr_flag everywhere.
* array.c (match_array_list): Pass on gfc_init_expr_flag when matching
iterators.
gcc/testsuite/:
2010-05-13 Daniel Franke <franke.daniel@gmail.com>
PR fortran/35779
* gfortran.dg/initialization_25.f90: New.
From-SVN: r159366
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r-- | gcc/fortran/expr.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index 92454f6..8230b46 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -1895,7 +1895,7 @@ gfc_simplify_expr (gfc_expr *p, int type) /* Only substitute array parameter variables if we are in an initialization expression, or we want a subsection. */ if (p->symtree->n.sym->attr.flavor == FL_PARAMETER - && (gfc_init_expr || p->ref + && (gfc_init_expr_flag || p->ref || p->symtree->n.sym->value->expr_type != EXPR_ARRAY)) { if (simplify_parameter_variable (p, type) == FAILURE) @@ -2626,11 +2626,11 @@ gfc_reduce_init_expr (gfc_expr *expr) { gfc_try t; - gfc_init_expr = 1; + gfc_init_expr_flag = true; t = gfc_resolve_expr (expr); if (t == SUCCESS) t = check_init_expr (expr); - gfc_init_expr = 0; + gfc_init_expr_flag = false; if (t == FAILURE) return FAILURE; @@ -2648,11 +2648,7 @@ gfc_reduce_init_expr (gfc_expr *expr) /* Match an initialization expression. We work by first matching an - expression, then reducing it to a constant. The reducing it to - constant part requires a global variable to flag the prohibition - of a non-integer exponent in -std=f95 mode. */ - -bool init_flag = false; + expression, then reducing it to a constant. */ match gfc_match_init_expr (gfc_expr **result) @@ -2663,12 +2659,12 @@ gfc_match_init_expr (gfc_expr **result) expr = NULL; - init_flag = true; + gfc_init_expr_flag = true; m = gfc_match_expr (&expr); if (m != MATCH_YES) { - init_flag = false; + gfc_init_expr_flag = false; return m; } @@ -2676,12 +2672,12 @@ gfc_match_init_expr (gfc_expr **result) if (t != SUCCESS) { gfc_free_expr (expr); - init_flag = false; + gfc_init_expr_flag = false; return MATCH_ERROR; } *result = expr; - init_flag = false; + gfc_init_expr_flag = false; return MATCH_YES; } |