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

2017-01-18 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79142 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[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 & 0x3f) + 1); if