]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/22038 (Forall with mask broken)
authorJakub Jelinek <jakub@redhat.com>
Mon, 13 Jun 2005 18:30:14 +0000 (20:30 +0200)
committerTobias Schlüter <tobi@gcc.gnu.org>
Mon, 13 Jun 2005 18:30:14 +0000 (20:30 +0200)
2005-06-13  Jakub Jelinek  <jakub@redhat.com>

PR fortran/22038
* trans-stmt.c (gfc_trans_forall_loop): Only increment maskindex
in the innermost loop.

From-SVN: r100889

gcc/fortran/ChangeLog
gcc/fortran/trans-stmt.c

index c3513f0fca2d03ce5944ecac9696f049b3a2f45d..21d6e2199bffd0ad2134352f3e03ec9814822433 100644 (file)
@@ -1,3 +1,9 @@
+2005-06-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/22038
+       * trans-stmt.c (gfc_trans_forall_loop): Only increment maskindex
+       in the innermost loop.
+
 2005-06-05  Jakub Jelinek  <jakub@redhat.com>
 
        Backport from the mainline:
index fc73dceece662a4bb3f7c054a054bbf9e1fa7239..027d1e160151cfcb2ffcba6028aa464bf6b3776d 100644 (file)
@@ -1367,8 +1367,9 @@ gfc_trans_forall_loop (forall_info *forall_tmp, int nvar, tree body, int mask_fl
       tmp = build2 (PLUS_EXPR, TREE_TYPE (var), var, step);
       gfc_add_modify_expr (&block, var, tmp);
 
-      /* Advance to the next mask element.  */
-      if (mask_flag)
+      /* Advance to the next mask element.  Only do this for the
+        innermost loop.  */
+      if (n == 0 && mask_flag)
         {
           mask = forall_tmp->mask;
           maskindex = forall_tmp->maskindex;