------- Comment #7 from pault at gcc dot gnu dot org  2009-03-17 08:31 -------
This fixes the PR:

Index: gcc/fortran/trans-stmt.c
===================================================================
--- gcc/fortran/trans-stmt.c    (revision 144197)
+++ gcc/fortran/trans-stmt.c    (working copy)
@@ -1713,6 +1719,7 @@

   /* Use the temporary as the backend_decl.  */
   new_sym->backend_decl = tse.expr;
+  DECL_ARTIFICIAL (new_sym->backend_decl) = 1;

   /* Create a fake symtree for it.  */
   root = NULL;
Index: gcc/fortran/trans-array.c
===================================================================
--- gcc/fortran/trans-array.c   (revision 144197)
+++ gcc/fortran/trans-array.c   (working copy)
@@ -2469,7 +2469,7 @@
       gfc_conv_expr_type (&indexse, ar->start[n], gfc_array_index_type);
       gfc_add_block_to_block (&se->pre, &indexse.pre);

-      if (flag_bounds_check)
+      if (flag_bounds_check && !DECL_ARTIFICIAL (se->expr))
        {
          /* Check array bounds.  */
          tree cond;

I am sure that this will cause regressions with array dummy arguments but this
is not intended to do anything other than demonstrate the need to mark the
temporaries produced in FORALL blocks.  These masquerade as symbols.  I suspect
that they should gain a temporary attribute or, alternatively, the condition
above should be a bit more complex.

Paul 


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pault at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-08-08 21:48:30         |2009-03-17 08:31:49
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36091

Reply via email to