Open Quuxplusone opened 5 years ago
Bugzilla Link | PR42631 |
Status | NEW |
Importance | P enhancement |
Reported by | David Bolvansky (david.bolvansky@gmail.com) |
Reported on | 2019-07-16 03:30:08 -0700 |
Last modified on | 2019-07-16 14:48:45 -0700 |
Version | trunk |
Hardware | PC Linux |
CC | craig.topper@gmail.com, lebedev.ri@gmail.com, llvm-bugs@lists.llvm.org, llvm-dev@redking.me.uk, richard-llvm@metafoo.co.uk, spatel+llvm@rotateright.com |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
1 << (x+1) is defined when x == -1, 2 << x is not.
It should be unsigned ‘x’ (as shown in alife proof). Sorry for misleading title (thanks Roman for title fix).
Ah, I see. The C source code example you give is not the same as the IR -- in the C source code, 1 << (x+1) should not have a 'nuw' on the add. Yeah, the transformation seems correct on that IR (but it's not correct on the C code).