[LLVMbugs] [Bug 7234] New: linking fails when compiling with -O4

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed May 26 01:28:59 PDT 2010


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

           Summary: linking fails when compiling with -O4
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: niebuhr at niebuhrt.de
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=4934)
 --> (http://llvm.org/bugs/attachment.cgi?id=4934)
The test Code

when compiling the attached source with
clang++ -O4 -o main main.cpp Out.cpp
I get the errors below. Without -O4 it compiles just fine.

I guess this is not a bug. I'm probably doing something wrong...what?

wll192-250:cpptest gmthor85$ clang++ -O4 -o main main.cpp Out.cpp
Operand is null
    %0 = tail call i32 @__cxa_atexit(void (i8*)* bitcast (void (%class.Out*)*
@_ZNSt8ios_base4InitD1Ev to void (i8*)*), <null operand!>, i8* bitcast (i8**
@__dso_handle to i8*))        ; <i32> [#uses=0]
Broken module found, compilation aborted!
Stack dump:
0.    Running pass 'Function Pass Manager' on module 'ld-temp.o'.
1.    Running pass 'Module Verifier' on function '@_GLOBAL__I_a'
clang: error: linker command failed due to signal 6 (use -v to see invocation)



With the Option -v



wll192-250:cpptest gmthor85$ clang++ -v -o main main.cpp Out.cppclang version
2.0 (trunk 104375)Target: x86_64-apple-darwin10
Thread model: posix
 "/Users/gmthor85/llvm/llvm/Release/bin/clang" -cc1 -triple
x86_64-apple-darwin10.0.0 -emit-obj -disable-free -main-file-name main.cpp
-pic-level 1 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2
-v -resource-dir /Users/gmthor85/llvm/llvm/Release/lib/clang/2.0 -ferror-limit
19 -fmessage-length 221 -stack-protector 1 -fblocks -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o
/var/folders/3C/3Cjb8XqLGZ4CudBSDgvEJE+++TI/-Tmp-/cc-jOK31C.o -x c++ main.cpp
clang -cc1 version 2.0 based upon llvm 2.8svn hosted on x86_64-apple-darwin10
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/4.2.1
 /usr/include/c++/4.2.1/i686-apple-darwin10/x86_64
 /usr/include/c++/4.2.1/backward
 /usr/include/c++/4.0.0
 /usr/include/c++/4.0.0/i686-apple-darwin8
 /usr/include/c++/4.0.0/backward
 /usr/local/include
 /Users/gmthor85/llvm/llvm/Release/lib/clang/2.0/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
 "/Users/gmthor85/llvm/llvm/Release/bin/clang" -cc1 -triple
x86_64-apple-darwin10.0.0 -emit-obj -disable-free -main-file-name Out.cpp
-pic-level 1 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2
-v -resource-dir /Users/gmthor85/llvm/llvm/Release/lib/clang/2.0 -ferror-limit
19 -fmessage-length 221 -stack-protector 1 -fblocks -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o
/var/folders/3C/3Cjb8XqLGZ4CudBSDgvEJE+++TI/-Tmp-/cc-ekCTgg.o -x c++ Out.cpp
clang -cc1 version 2.0 based upon llvm 2.8svn hosted on x86_64-apple-darwin10
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/4.2.1
 /usr/include/c++/4.2.1/i686-apple-darwin10/x86_64
 /usr/include/c++/4.2.1/backward
 /usr/include/c++/4.0.0
 /usr/include/c++/4.0.0/i686-apple-darwin8
 /usr/include/c++/4.0.0/backward
 /usr/local/include
 /Users/gmthor85/llvm/llvm/Release/lib/clang/2.0/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
 "/usr/libexec/gcc/i686-apple-darwin10/4.2.1/ld" -dynamic -arch x86_64
-macosx_version_min 10.6.0 -o main -lcrt1.10.6.o
-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64
-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64
-L/usr/lib/i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1
-L/usr/lib/gcc/i686-apple-darwin10/4.2.1
-L/Users/gmthor85/llvm/llvm/Release/bin/../lib
-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../../i686-apple-darwin10/4.2.1
-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../..
/var/folders/3C/3Cjb8XqLGZ4CudBSDgvEJE+++TI/-Tmp-/cc-jOK31C.o
/var/folders/3C/3Cjb8XqLGZ4CudBSDgvEJE+++TI/-Tmp-/cc-ekCTgg.o -lstdc++ -lSystem
-lgcc

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list