This is the mail archive of the
mailing list for the GCC project.
- From: Diego Novillo <dnovillo at redhat dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 17 Nov 2004 16:10:14 -0500
- Subject: Fix 18307
- Organization: Red Hat Canada
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.
* 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.
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)
+ 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
- merge_pointed_to_info (ai, lhs, var);
+ /* Avoid unnecessary merges. */
+ if (lhs != var)
+ merge_pointed_to_info (ai, lhs, var);