https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98845

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
+find_duplicates: <bb 6> duplicate of <bb 20>
+Removing basic block 20

@@ -170,7 +180,7 @@
   <bb 17> [local count: 3614577]:
   goto <bb 13>; [100.00%]

-  <bb 6> [local count: 7016531]:
+  <bb 6> [local count: 8742389]:
   p_218_24 = p_217_23(D)(ab);
   p_217_32 = p_217_23(D)(ab);
   goto <bb 13>; [100.00%]
@@ -213,12 +223,10 @@
   if (p_218_8 != 0)
     goto <bb 19>; [83.51%]
   else
-    goto <bb 20>; [16.49%]
-
-  <bb 20> [local count: 1725858]:
+    goto <bb 6>; [16.49%]

   <bb 13> [local count: 12356965]:
-  # _9 = PHI <1(17), 0(20), 0(6)>
+  # _9 = PHI <1(17), 0(6)>
   return _9;

but that makes _23(D) live on the path from bb 12 to bb 13.  The issue here
is that _23 and _32 are unused but their RHS is still accounted for during
LIVE problem solving but they are ignored during VN and by tail-merging
which just looks at BB side-effects.

So the testcase is really an artifact of -fno-tree-dce.

One could argue that tail merging should treat a use of abnormals as
side-effect but I think that won't play well with its structure.

Reply via email to