Mercurial > hg > CbC > CbC_gcc
comparison 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 |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
1 /* PR middle-end/93505 */ | |
2 | |
3 unsigned a; | |
4 | |
5 unsigned | |
6 foo (unsigned x) | |
7 { | |
8 unsigned int y = 32 - __builtin_bswap64 (-a); | |
9 /* This would be UB (x << 32) at runtime. Ensure we don't | |
10 invoke UB in the compiler because of that (visible with | |
11 bootstrap-ubsan). */ | |
12 x = x << y | x >> (-y & 31); | |
13 x >>= 31; | |
14 return x; | |
15 } |