view gcc/testsuite/gcc.c-torture/compile/pr93505.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
line wrap: on
line source

/* PR middle-end/93505 */

unsigned a;

unsigned
foo (unsigned x)
{
  unsigned int y = 32 - __builtin_bswap64 (-a);
  /* This would be UB (x << 32) at runtime.  Ensure we don't
     invoke UB in the compiler because of that (visible with
     bootstrap-ubsan).  */
  x = x << y | x >> (-y & 31);
  x >>= 31;
  return x;
}