]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR ipa/65270 (issues with merging memory accesses from different code paths)
authorRichard Biener <rguenther@suse.de>
Thu, 5 Mar 2015 08:43:13 +0000 (08:43 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 5 Mar 2015 08:43:13 +0000 (08:43 +0000)
2015-03-05  Richard Biener  <rguenther@suse.de>

PR ipa/65270
* ipa-icf-gimple.c (func_checker::compare_memory_operand):
Compare dependence info.

From-SVN: r221204

gcc/ChangeLog
gcc/ipa-icf-gimple.c

index 93b88681e5f877f318936eed6c133b84e3bcdbc0..a50a378044e590ea1f8802d187aa2749e8efb96f 100644 (file)
@@ -1,3 +1,9 @@
+2015-03-05  Richard Biener  <rguenther@suse.de>
+
+       PR ipa/65270
+       * ipa-icf-gimple.c (func_checker::compare_memory_operand):
+       Compare dependence info.
+
 2015-03-05  Richard Biener  <rguenther@suse.de>
 
        PR middle-end/65233
index ffb4a50cb6d950bc999b4384ef6425264f383c1b..4f1a8ce6e95307059a17da1ad498529d3b73225a 100644 (file)
@@ -305,6 +305,23 @@ func_checker::compare_memory_operand (tree t1, tree t2)
       get_object_alignment_1 (b2, &align2, &tem);
       if (align1 != align2)
        return return_false_with_msg ("different access alignment");
+
+      /* Similarly we have to compare dependence info where equality
+         tells us we are safe (even some unequal values would be safe
+        but then we have to maintain a map of bases and cliques).  */
+      unsigned short clique1 = 0, base1 = 0, clique2 = 0, base2 = 0;
+      if (TREE_CODE (b1) == MEM_REF)
+       {
+         clique1 = MR_DEPENDENCE_CLIQUE (b1);
+         base1 = MR_DEPENDENCE_BASE (b1);
+       }
+      if (TREE_CODE (b2) == MEM_REF)
+       {
+         clique2 = MR_DEPENDENCE_CLIQUE (b2);
+         base2 = MR_DEPENDENCE_BASE (b2);
+       }
+      if (clique1 != clique2 || base1 != base2)
+       return return_false_with_msg ("different dependence info");
     }
 
   return compare_operand (t1, t2);