https://bugs.llvm.org/show_bug.cgi?id=40402
Tim Northover <[email protected]> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |INVALID
CC| |[email protected]
--- Comment #1 from Tim Northover <[email protected]> ---
C and C++ don't allow you to shift an n-bit number by exacltly n places (or
more). It's classified as "undefined behaviour" and compilers will assume it
doesn't happen when optimizing code.
The algorithm in the attached file flags up multiple cases of this when
compiled with -fsanitize=undefined, so there's a very good chance that's the
issue.
If you haven't encountered undefined behaviour before, Chris Lattner wrote a
good blog series on it, and how it affects C compilers, a few years ago:
http://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html.
Let us know if you can reproduce the issue after fixing t.c, but for now I'll
close this.
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs