[LLVMbugs] [Bug 7174] New: Can't assemble LLVM-GCC's assembly with multiple case statements

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed May 19 13:13:15 PDT 2010


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

           Summary: Can't assemble LLVM-GCC's assembly with multiple case
                    statements
           Product: new-bugs
           Version: 2.7
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: mark.aldham at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=4910)
 --> (http://llvm.org/bugs/attachment.cgi?id=4910)
Simple test case to illustrate issue.

Since the MIPS backend cannot yet produce elf files, my current flow is as
follows:
1) LLVM-GCC compiles C->bitcode
2) LLC compiles bitcode->mips assembly
3) GCC's AS assembles the mips assembly into object file
4) GCC's LD links object files into ELF file

When the C file contains a switch statement with many cases (it seems to be >3
cases causes the problem), the assembly produced with LLC cannot be assembled. 
It fails with the following result: 
switches.s: Assembler messages:
switches.s:27: Error: illegal operands `lw $3,0(%lo($JTI1_0))'

This is with LLVM 2.7, and llvm-gcc (GCC) 4.2.1.
The cross-compiler used is:
GNU assembler (GNU Binutils) 2.20

The following commands are used to compile:
llvm-gcc switches.c -O2 -emit-llvm -c -o switches.bc
llc switches.bc -march=mipsel -relocation-model=static
-mips-ssection-threshold=0 -mcpu=mips1 -f -o switches.s
mipsel-unknown-elf-as switches.s -g -mips1 -mabi=eabi -o switches.o

-- 
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