[llvm-bugs] [Bug 34827] Csmith program prints checksum at -O0, but crashes at -O1

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Oct 4 06:38:21 PDT 2017


Jonas Paulsson <paulsson at linux.vnet.ibm.com> changed:

           What    |Removed                     |Added
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED

--- Comment #2 from Jonas Paulsson <paulsson at linux.vnet.ibm.com> ---
Thanks for explaining.

I see that at-O1 clang inserts a 'trap' instruction before an 'unreachable'. I
suppose this then just means as you explained that LLVM has detected an
undefined behaviour and inserts a trap so that the program terminates.

At -O0, the 'unreachable' becomes an empty (machine) basic block which then
will certainly be undefined behaviour in this case, as it is last in the linear
layout of the function (and reached via a conditional jump)...

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171004/dd4ad4a6/attachment.html>

More information about the llvm-bugs mailing list