[Bug tree-optimization/126720] [15/16/17 Regression] wrong code with -O3 since r15-2275

"jakub at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126720

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[15/16/17 Regression] wrong |[15/16/17 Regression] wrong
                   |code with -O3               |code with -O3 since
                   |                            |r15-2275
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |law at gcc dot gnu.org
           Keywords|needs-bisection             |

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r15-2275-g679086172b84be18c55fdbb9cda7e97806e7c083
Slightly cleaned up testcase:
typedef short V __attribute__((vector_size (sizeof (int))));
typedef unsigned short W __attribute__((vector_size (sizeof (int))));
unsigned a;
unsigned char b;
_Bool c;

int
main ()
{
#if __SIZEOF_SHORT__ == 2 && __SIZEOF_INT__ == 4
  unsigned short d;
  W e;
  unsigned short f = 0;
l1:
  d = ~f;
  e = (W) 0;
  f = d;
  d = e[b];
  e = (((union { unsigned src; W dst; }) (unsigned) f).dst);
  e = (V) e < 0;
  f = 29834 >> d;
  e = __builtin_shufflevector (e, e, 3, 1);
  e = ~e;
l2:
  e = ~e;
  e = ~e;
  e[1] = ~f;
l3:
  switch (~(((union { W src; unsigned dst }) e).dst))
    {
    case 1955201024:
      goto l5;
    case 4033962:
      goto l4;
    default:
      __builtin_trap ();
    }
l4:
  if (c)
    goto l2;
  goto l1;
l5:
  e = e >= 0;
  if (d == 3)
    return 0;
  a = a > 0U;
  if (b)
    goto l3;
#endif
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.