aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2007-02-18 19:52:16 +0000
committerPaul Thomas <pault@gcc.gnu.org>2007-02-18 19:52:16 +0000
commit9bffa1718a6f2edeeec1aec1f4afef0ff69584ce (patch)
tree3f2fa297f1a33544a955895add48c12f2b3ee9e3 /gcc/fortran
parent078a18a42304f0caa644fb42c37b55fc59673d00 (diff)
downloadgcc-9bffa1718a6f2edeeec1aec1f4afef0ff69584ce.zip
gcc-9bffa1718a6f2edeeec1aec1f4afef0ff69584ce.tar.gz
gcc-9bffa1718a6f2edeeec1aec1f4afef0ff69584ce.tar.bz2
re PR fortran/30400 (ANY not accepted as mask in FORALL)
2007-02-18 Roger Sayle <roger@eyesopen.com> Paul Thomas <pault@gcc.gnu.org> PR fortran/30400 * match.c (match_forall_iterator): Use gfc_match_expr instead of gfc_match_variable to match the iterator variable. Return MATCH_NO if not a variable. Remove the reset of the symbol's flavor in cleanup. 2007-02-18 Roger Sayle <roger@eyesopen.com> * gfortran.dg/forall_10.f90: New test case. Co-Authored-By: Paul Thomas <pault@gcc.gnu.org> From-SVN: r122102
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog9
-rw-r--r--gcc/fortran/match.c16
2 files changed, 16 insertions, 9 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 02ba34f..43c10ee 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,12 @@
+2007-02-18 Roger Sayle <roger@eyesopen.com>
+ Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/30400
+ * match.c (match_forall_iterator): Use gfc_match_expr instead
+ of gfc_match_variable to match the iterator variable. Return
+ MATCH_NO if not a variable. Remove the reset of the symbol's
+ flavor in cleanup.
+
2007-02-16 Tobias Burnus <burnus@net-b.de>
PR fortran/30793
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index 941e625..bf78911 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -3358,7 +3358,10 @@ gfc_free_forall_iterator (gfc_forall_iterator *iter)
/* Match an iterator as part of a FORALL statement. The format is:
- <var> = <start>:<end>[:<stride>][, <scalar mask>] */
+ <var> = <start>:<end>[:<stride>]
+
+ On MATCH_NO, the caller tests for the possibility that there is a
+ scalar mask expression. */
static match
match_forall_iterator (gfc_forall_iterator **result)
@@ -3370,11 +3373,12 @@ match_forall_iterator (gfc_forall_iterator **result)
where = gfc_current_locus;
iter = gfc_getmem (sizeof (gfc_forall_iterator));
- m = gfc_match_variable (&iter->var, 0);
+ m = gfc_match_expr (&iter->var);
if (m != MATCH_YES)
goto cleanup;
- if (gfc_match_char ('=') != MATCH_YES)
+ if (gfc_match_char ('=') != MATCH_YES
+ || iter->var->expr_type != EXPR_VARIABLE)
{
m = MATCH_NO;
goto cleanup;
@@ -3415,12 +3419,6 @@ syntax:
m = MATCH_ERROR;
cleanup:
- /* Make sure that potential internal function references in the
- mask do not get messed up. */
- if (iter->var
- && iter->var->expr_type == EXPR_VARIABLE
- && iter->var->symtree->n.sym->refs == 1)
- iter->var->symtree->n.sym->attr.flavor = FL_UNKNOWN;
gfc_current_locus = where;
gfc_free_forall_iterator (iter);