[llvm-bugs] [Bug 39917] New: r343018 triggers miscompile of Regression-C++-throw_rethrow_test

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Dec 7 10:23:53 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=39917

            Bug ID: 39917
           Summary: r343018 triggers miscompile of
                    Regression-C++-throw_rethrow_test
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: vsk at apple.com
                CC: llvm-bugs at lists.llvm.org

I traced down a miscompile I’m seeing to this commit.

Consider these two IR files (generated from
SingleSource/Regression/C++/EH/Regression-C++-throw_rethrow_test). One is
compiled normally (at -Os). The other is compiled with hot/cold splitting,
which outlines a `resume` instruction and moves some code into a “cold”
function.

Before this commit, both tests would terminate and print the correct result:

- clang++ no-outlining.ll -o no-outlining && ./no-outlining # Prints correct
result and exits.
- clang++ with-outlining.ll -o with-outlining && ./with-outlining # Prints
correct result and exits.

(expected) $ ./no-outlining # (or ./with-outlining)
0: 1
1: 1
2: 1
3: 2
4: 2
5: 2
6: 3
7: 3
8: 3

However, after this commit, the “with-outlining” binary hangs:

(bug) $ ./with-outlining.bad 
0: 1
1: 1
2: 1
3: 2
4: 2
5: 2
^C

I've attached the assembly for the “with-outlining” binary before and after
this commit.

If I revert this commit locally, I get the expected result again on
“with-outlining.ll”.

-- 
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/20181207/42bb0052/attachment.html>


More information about the llvm-bugs mailing list