This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix 18307

We were calling merge_pointed_to_info trying to merge the pointed-to
information of a variable with itself.  This patch prevents that and
ICEs if we ever try to do that.

Bootstrapped and tested x86, x86-64 and ppc.


	PR tree-optimization/18307
	* tree-ssa-alias.c (merge_pointed_to_info): ICE if 'dest' and
	'orig' are the same node.
	(collect_points_to_info_r): Do not call merge_pointed_to_info
	when the PHI argument is identical to the LHS.

Index: tree-ssa-alias.c
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-alias.c,v
retrieving revision 2.53
diff -d -c -p -u -r2.53 tree-ssa-alias.c
--- tree-ssa-alias.c	12 Nov 2004 00:08:41 -0000	2.53
+++ tree-ssa-alias.c	17 Nov 2004 20:59:42 -0000
@@ -1697,12 +1697,8 @@ merge_pointed_to_info (struct alias_info
   struct ptr_info_def *dest_pi, *orig_pi;
-  /* FIXME: It is erroneous to call this function with identical
-     nodes, however that currently occurs during bootstrap.  This check
-     stops further breakage.  PR 18307 documents the issue.  */
-  if (dest == orig)
-    return;
+  gcc_assert (dest != orig);
   /* Make sure we have points-to information for ORIG.  */
   collect_points_to_info_for (ai, orig);
@@ -1938,7 +1934,9 @@ collect_points_to_info_r (tree var, tree
 	  case SSA_NAME:
-	    merge_pointed_to_info (ai, lhs, var);
+	    /* Avoid unnecessary merges.  */
+	    if (lhs != var)
+	      merge_pointed_to_info (ai, lhs, var);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]