[PATCH] Avoid changing shared trees in scan_omp_1_op

Richard Guenther rguenther@suse.de
Mon Mar 15 16:09:00 GMT 2010


Seen with some optimizations disabled for 
libgomp/libgomp.c/appendix-a/a.29.1.c, manifests as ICE in
build_int_cst_wide.

Jakub, anything obvious I'm missing here?  The type of the
integer constant gets replaced by <error_mark_node> and
we get int[0:<<< error >>>][0:<<< error >>>] * in place of
the existing int[0:D.2764][0:D.2758] *.  Do we need
to do the substitution, thus copy_rtx if the type is
remapped?

Thanks,
Richard.

2010-03-15  Richard Guenther  <rguenther@suse.de>

	* omp-low.c (scan_omp_1_op): Do not change shared trees.

Index: omp-low.c
===================================================================
--- omp-low.c	(revision 157457)
+++ omp-low.c	(working copy)
@@ -1932,7 +1932,8 @@ scan_omp_1_op (tree *tp, int *walk_subtr
       else if (!DECL_P (t))
 	{
 	  *walk_subtrees = 1;
-	  if (ctx)
+	  if (ctx
+	      && !tree_node_can_be_shared (t))
 	    TREE_TYPE (t) = remap_type (TREE_TYPE (t), &ctx->cb);
 	}
       break;



More information about the Gcc-patches mailing list