[Bug tree-optimization/98365] Miss vectoization for signed char ifcvt

crazylht at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Jan 5 10:06:57 GMT 2021


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

--- Comment #5 from Hongtao.liu <crazylht at gmail dot com> ---
> 
> And successully vectorized.
> 

Also vectorized loop with cnt defined as signed short.
.i.e
int foo (short a[64], short c[64])
{
  int i;
  short cnt=0;
  for (int i = 0;i != 64; i++)
    if (a[i] == c[i])
      cnt++;
  return cnt;
}

Since signed integer overflow is undefined in C++ and C, gcc would always
convert signed char/short to unsigned char/short to avoid UB, and ifcvt should
be able to "properly" hanlde those nop conversion.


More information about the Gcc-bugs mailing list