https://llvm.org/bugs/show_bug.cgi?id=27546
Bug ID: 27546 Summary: Incorrect code generated with unusual bitvector sizes Product: new-bugs Version: 3.8 Hardware: PC OS: MacOS X Status: NEW Severity: normal Priority: P Component: new bugs Assignee: unassignedb...@nondot.org Reporter: nitpicker2...@gmail.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified Created attachment 16277 --> https://llvm.org/bugs/attachment.cgi?id=16277&action=edit Bug test case The attached LLVM assembly file demonstrates the bug. Certain code sequences involving unusual bitvector sizes (i65, in particular) seem to generate incorrect code. In the attached file, the procedure @bug_proc performs some bit-manipulations on its argument, which is supposed to result in the temporary %t5 containing the original value zero extended to i65. This value is negated and returned. The procedure @correct_proc does a zero extend directly and then negates and returns. I claim both procedures should be semantically identical, which should result in the main function always returning a 0 exit code. However, this is not the case. For some arguments, and at some optimization levels, these procedures differ and the program returns exit code -1. As best I can tell, the attached program should not exhibit undefined behavior. ``` $ clang --version Apple LLVM version 7.0.0 (clang-700.1.76) Target: x86_64-apple-darwin15.4.0 Thread model: posix $ clang -O0 -o bug bug.ll; ./bug; echo $? 255 $ clang -O1 -o bug bug.ll; ./bug; echo $? 255 $ clang -O2 -o bug bug.ll; ./bug; echo $? 0 $ clang -O3 -o bug bug.ll; ./bug; echo $? 0 $ clang -Os -o bug bug.ll; ./bug; echo $? 0 ``` I get identical behavior from clang version 3.6.2 and clang 3.8.0 (installed via Homebrew). -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs