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

Tamar Christina <tnfchris at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |---
             Status|RESOLVED                    |REOPENED

--- Comment #7 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
The testcase I posted above is still not lowered by ifcvt

https://godbolt.org/z/44vd76eKx

short a[100];

int foo(int n, int counter)
{
   for (int i = 0; i < n; i++)
     {
        if (a[i] == 1 || a[i] == 2 || a[i] == 7 || a[i] == 4)
          return 1;
     }
    return 0;
}

still produces:

  <bb 2> [local count: 114863530]:
  if (n_8(D) > 0)
    goto <bb 6>; [94.50%]
  else
    goto <bb 11>; [5.50%]

  <bb 6> [local count: 108546036]:

  <bb 3> [local count: 1014686025]:
  # i_2 = PHI <i_11(7), 0(6)>
  _10 = a[i_2];
  switch (_10) <default: <L8> [94.50%], case 1 ... 2: <L10> [5.50%], case 4:
<L10> [5.50%], case 7: <L10> [5.50%]>

  <bb 9> [local count: 55807731]:
<L10>:
  goto <bb 5>; [100.00%]

with last night's compiler.

Reply via email to