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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Here is an even odder case:
```
#define N 256
typedef short T;
extern T a[N];
extern T b[N];
extern T c[N];
extern _Bool pb[N];
extern _Bool pb1[N];
extern _Bool pb2[N];

void predicate_by_booland()
{
  for (int i = 0; i < N; i++)
    c[i] = ((pb1[i] != pb[i]) != pb2[i]) ? a[i] : b[i];
}
```
This vectorizes currently with `-O3` but not with `-O3 -fno-tree-vrp`.
IR with -fno-tree-vrp:
```
  _1 = pb1[i_15];
  _2 = pb[i_15];
  _3 = _1 != _2;
  _4 = pb2[i_15];
  iftmp.0_10 = a[i_15];
  _5 = _3 != _4;
  iftmp.0_9 = b[i_15];
```
IR without (VRP turned on):
```
  _1 = pb1[i_15];
  _2 = pb[i_15];
  _3 = _1 ^ _2;
  _4 = pb2[i_15];
  iftmp.0_10 = a[i_15];
  _5 = _3 != _4;
  iftmp.0_9 = b[i_15];
```

So it is even more confusing ...

Reply via email to