[llvm-bugs] [Bug 40657] IR programs printing incorrect results after being compiled with -O0
via llvm-bugs
llvm-bugs at lists.llvm.org
Sun Feb 10 07:03:46 PST 2019
https://bugs.llvm.org/show_bug.cgi?id=40657
Sanjay Patel <spatel+llvm at rotateright.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|CONFIRMED |RESOLVED
Fixed By Commit(s)| |r353615, r353639
Resolution|--- |FIXED
--- Comment #10 from Sanjay Patel <spatel+llvm at rotateright.com> ---
All attached examples should be fixed after:
https://reviews.llvm.org/rL353639
Feel free to reopen if that's not correct.
Side note about fuzzing for LLVM bugs:
If you're looking for backend bugs, it might be worth trying something like
this:
$ clang -O2 test.c -S -emit-llvm -Xclang -disable-llvm-optzns -o
unoptimized_ir.ll
$ llc -O2 unoptimized_ir.ll -o unoptimized_ir_optimized_asm.s
$ clang unoptimized_ir_optimized_asm.s -o maybe_buggy_executable
$ clang test.c -o reference_executable
$ { compare output of } reference_executable maybe_buggy_executable
A lot of people get that 1st step wrong: you want clang to create an IR file
that allows optimization by the backend, but skip intermediate optimization.
That doesn't happen if you use "-O0 -emit-llvm" with clang.
--
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/20190210/24ce3e63/attachment.html>
More information about the llvm-bugs
mailing list