http://llvm.org/bugs/show_bug.cgi?id=22456

            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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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!
<0x29f3a68>
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to