[LLVMbugs] [Bug 22715] New: LTO default target CPU should be "pentium4" for 32-bit Linux

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Feb 26 13:22:24 PST 2015


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

            Bug ID: 22715
           Summary: LTO default target CPU should be "pentium4" for 32-bit
                    Linux
           Product: new-bugs
           Version: 3.6
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: t.poechtrager at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 13954
  --> http://llvm.org/bugs/attachment.cgi?id=13954&action=edit
lto cpu patch

... otherwise codegening bitcode files may fail:

For explanation: bc2obj is a tool I wrote to convert bitcode libraries into
native ones, now feeding it with Linux 32-bit LLVM libraries I came
accross the following problem:

$ bc2obj [...]libclangBasic.a 
[...]
codegen'ing [...]libclangBasic.a(SourceManager.o) to
/tmp/-9b1d81/SourceManager.o
LLVM ERROR: Do not know how to split this operator's operand!

Inspecting the compilation command reveals that the default 32-bit target cpu
is
"pentium4":

$ clang++ -m32 [...] -fPIC -fvisibility-inlines-hidden [...] -fdata-sections
-O3 -DNDEBUG  [...] SourceManager.cpp -flto -c -v
 "/opt/compiler/llvm-3.6/bin/clang-3.6" -cc1 -triple i386-unknown-linux-gnu
-emit-llvm-bc [...] -target-cpu pentium4 [...]

Now either setting the target cpu to pentium4 or enabling sse2 gets rid of the
problem:

$ bc2obj SourceManager.o -cpu=pentium4
codegen'ing SourceManager.o to native/SourceManager.o

$ file native/SourceManager.o 
native/SourceManager.o: ELF 32-bit LSB relocatable, Intel 80386, version 1
(GNU/Linux), not stripped

$ bc2obj SourceManager.o -attrs=+sse2
codegen'ing SourceManager.o to native/SourceManager.o

$ file native/SourceManager.o 
native/SourceManager.o: ELF 32-bit LSB relocatable, Intel 80386, version 1
(GNU/Linux), not stripped

A possible fix is attached (but totally untested besides the pentium4 part).

-- 
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/20150226/5d097249/attachment.html>


More information about the llvm-bugs mailing list