]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/18307 (merge_pointed_to_info called incorrectly)
authorNathan Sidwell <nathan@codesourcery.com>
Fri, 5 Nov 2004 10:56:01 +0000 (10:56 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Fri, 5 Nov 2004 10:56:01 +0000 (10:56 +0000)
PR tree-optimization/18307
* tree-ssa-alias.c (merge_pointed_to_info): Protected against DEST
and ORIG being the same node.

From-SVN: r90120

gcc/ChangeLog
gcc/tree-ssa-alias.c

index a3cb64e968f6b364c159d688ecd4d29feae9f9c7..7ad955160b82a5612faafe1586150a8dc0f0f58f 100644 (file)
@@ -1,3 +1,9 @@
+2004-11-05  Nathan Sidwell  <nathan@codesourcery.com>
+
+       PR tree-optimization/18307
+       * tree-ssa-alias.c (merge_pointed_to_info): Protected against DEST
+       and ORIG being the same node.
+
 2004-11-04  Geoffrey Keating  <geoffk@apple.com>
 
        * Makefile.in (distclean): Don't delete nonexistent fixinc/ directory.
index 976f2d1b0fc92d1e4d9290fa9c1140c833c55208..8e424275b173267366151922645836bae404b3c8 100644 (file)
@@ -1687,14 +1687,21 @@ set_pt_malloc (tree ptr)
 }
 
 
-/* Given two pointers DEST and ORIG.  Merge the points-to information in
-   ORIG into DEST.  AI is as in collect_points_to_info.  */
+/* Given two different pointers DEST and ORIG.  Merge the points-to
+   information in ORIG into DEST.  AI is as in
+   collect_points_to_info.  */
 
 static void
 merge_pointed_to_info (struct alias_info *ai, tree dest, tree orig)
 {
   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;
+  
   /* Make sure we have points-to information for ORIG.  */
   collect_points_to_info_for (ai, orig);
 
@@ -1725,6 +1732,8 @@ merge_pointed_to_info (struct alias_info *ai, tree dest, tree orig)
         smart enough to determine that the two come from the same
         malloc call.  Copy propagation before aliasing should cure
         this.  */
+      gcc_assert (orig_pi != dest_pi);
+      
       dest_pi->pt_malloc = 0;
 
       if (orig_pi->pt_malloc || orig_pi->pt_anything)