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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
This goes wrong during dom2.  Before that we have still correct:
  <bb 2> [local count: 1073741825]:
  if (q5_4(D) != 0)
    goto <bb 3>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 3> [local count: 536870912]:

  <bb 4> [local count: 1073741825]:
  # iftmp.0_2 = PHI <1(3), q5_4(D)(2)>
  _1 = nd_5(D) <= 1 ? iftmp.0_2 : 0;
  if (_1 != 0)
    goto <bb 6>; [50.00%]
  else
    goto <bb 5>; [50.00%]

  <bb 5> [local count: 536870912]:

  <bb 6> [local count: 1073741825]:
  # iftmp.2_3 = PHI <nd_5(D)(4), 0(5)>
  yf = iftmp.2_3;
in pl, and dom2 changes it as:
   <bb 4> [local count: 1073741825]:
-  # iftmp.0_2 = PHI <1(3), q5_4(D)(2)>
-  _1 = nd_5(D) <= 1 ? iftmp.0_2 : 0;
-  if (_1 != 0)
-    goto <bb 6>; [50.00%]
-  else
-    goto <bb 5>; [50.00%]
-
-  <bb 5> [local count: 536870912]:
-
-  <bb 6> [local count: 1073741825]:
-  # iftmp.2_3 = PHI <nd_5(D)(4), 0(5)>
-  yf = iftmp.2_3;
+  # RANGE [0, 1] NONZERO 1
+  # iftmp.0_8 = PHI <0(2), 1(3)>
+  # RANGE [0, 1] NONZERO 1
+  _9 = nd_5(D) <= 1 ? iftmp.0_8 : 0;
+  yf = 0;

Now, the iftmp.0_2 to iftmp.0_8 and _1 to _9 changes look reasonable, but it
doesn't imply yf is 0.  Jeff, will leave this to you if you don't mind.

Reply via email to