[LLVMbugs] [Bug 22456] New: LTO build-time crash when building at -O2 -g

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Feb 3 22:47:58 PST 2015


            Bug ID: 22456
           Summary: LTO build-time crash when building at -O2 -g
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: lto
          Assignee: unassignedbugs at nondot.org
          Reporter: warren_ristow at playstation.sony.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The following "test.cpp" (along with the stub "alpha.cpp", for completeness)
gets a crash at build-time during LTO, when both -O2 and -g are used.
Tested with r228115.  Target: x86_64-unknown-linux-gnu

// ================ test.cpp =================
float alpha();
struct Bravo {
  Bravo(float) {}
struct Charlie {
  Charlie(Bravo delta) { echo(0, 0); }
  void echo(Bravo, float) { alpha(); }
void foxtrot(Bravo) { Charlie(Bravo(0)); }
int main(){}
// ===========================================

// ================ alpha.cpp ================
float alpha() { return 0.0f; }
// ===========================================

$ clang++ -c -O2 -g -flto alpha.cpp test.cpp
$ clang++ -o tst.x -flto alpha.o test.o
All nodes should be resolved!
LLVM ERROR: Broken function found, compilation aborted!
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The build succeeds if either the optimization level is dropped to -O1, or -g
is removed.

Bisecting it indicates that it began failing with r226736.

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/20150204/4a158788/attachment.html>

More information about the llvm-bugs mailing list