>       * gimplify.c (gimplify_decl_expr): Clear TREE_READONLY on the DECL
>       when really creating an initialization statement for it.

Quite an interesting can of worms I have opened it seems. :-(  So the change  
apparently causes OMP lowering to create dangling references, I have applied 
the attached stopgap fix in order to buy me some time to properly debug it.


        * gimplify.c (gimplify_decl_expr): Do not clear TREE_READONLY on a
        DECL which is a reference for OMP.

-- 
Eric Botcazou
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index ed825a93aa1..54bf59ab9d0 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -1829,7 +1829,7 @@ gimplify_decl_expr (tree *stmt_p, gimple_seq *seq_p)
 	      gimplify_and_add (init, seq_p);
 	      ggc_free (init);
 	      /* Clear TREE_READONLY if we really have an initialization.  */
-	      if (!DECL_INITIAL (decl))
+	      if (!DECL_INITIAL (decl) && !omp_is_reference (decl))
 		TREE_READONLY (decl) = 0;
 	    }
 	  else

Reply via email to