[Bug c/79142] bit shift + compare returns wrong value

2017-01-18 Thread layer at known dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79142 --- Comment #1 from layer at known dot net --- And the code: #include /* whatever the shift in badexample does, * the function should never return 1 */ long badexample(unsigned long iv) { long ov = ((long)(1)) << ((iv &

[Bug c/79142] New: bit shift + compare returns wrong value

2017-01-18 Thread layer at known dot net
Assignee: unassigned at gcc dot gnu.org Reporter: layer at known dot net Target Milestone: --- $ cc -v -save-temps -O -Wall -Wextra gccbug2.c Using built-in specs. COLLECT_GCC=/usr/bin/cc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/6.3.1/lto-wrapper Target: x86_64