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

            Bug ID: 110278
           Summary: [14 Regression] FAIL: gcc.dg/tree-ssa/pr103257-1.c
                    scan-tree-dump-times optimized "link_error" 0 from
                    r14-1880-g827e208fa64771
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

r14-1880-g827e208fa64771 causes

FAIL: gcc.dg/tree-ssa/pr103257-1.c scan-tree-dump-times optimized "link_error"
0

because we now fold more in .original:

-  if (a ((unsigned int) ((0, 1) && b != 0) > b, (int) (short int) c) != 0)
+  if (a ((unsigned int) (b != 0) > b, (int) (short int) c) != 0)

the call to link_error was optimized away in threadfull1 before this change,
after the change code is straight-line and no jump threading opportunity
is realized.

Before we enter threadfull1 with

  <bb 2> [local count: 1073741824]:
  c.0_1 = c;
  b.2_2 = b;
  if (b.2_2 != 0)
    goto <bb 4>; [50.00%]
  else
    goto <bb 3>; [50.00%]

  <bb 3> [local count: 536870913]:

  <bb 4> [local count: 1073741824]:
  # iftmp.1_5 = PHI <1(2), 0(3)>
  iftmp.3_3 = (unsigned int) iftmp.1_5;
  _4 = b.2_2 < iftmp.3_3;
  e.5_10 = (unsigned short) _4;
  f.6_11 = (unsigned short) c.0_1;
  _12 = e.5_10 * f.6_11;
  if (_12 != 0)
    goto <bb 5>; [33.00%]
  else
    goto <bb 6>; [67.00%]

  <bb 5> [local count: 354334800]:
  link_error ();

  <bb 6> [local count: 1073741824]:
  c = 0;
  return 0;

but afterwards the b != 0 condition is in straight-line code:

  <bb 2> [local count: 1073741824]:
  c.0_1 = c;
  b.1_2 = b;
  _3 = b.1_2 != 0;
  _4 = (unsigned int) _3;
  _5 = b.1_2 < _4;
  e.3_10 = (unsigned short) _5;
  f.4_11 = (unsigned short) c.0_1;
  _12 = e.3_10 * f.4_11;
  if (_12 != 0)
    goto <bb 3>; [33.00%]
  else
    goto <bb 4>; [67.00%]

  <bb 3> [local count: 354334800]:
  link_error ();

  <bb 4> [local count: 1073741824]:
  c = 0;
  return 0;

Reply via email to