[LLVMbugs] [Bug 7175] New: LLVM-GCC produces MIPS assembly that compares 64-bit longs incorrectly.

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


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

           Summary: LLVM-GCC produces MIPS assembly that compares 64-bit
                    longs incorrectly.
           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=4911)
 --> (http://llvm.org/bugs/attachment.cgi?id=4911)
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 run, comparisons between two longs isn't done properly -- it seems to just
compare the lower 32bits.

My system:
Linux x86_64 GNU/Linux

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 long_compare.c -O2 -emit-llvm -c -o long_compare.bc
llc long_compare.bc -march=mipsel -relocation-model=static
-mips-ssection-threshold=0 -mcpu=mips1 -f -o long_compare.s
mipsel-unknown-elf-as long_compare.s -g -mips1 -mabi=eabi -o long_compare.o
mipsel-unknown-elf-ld -Ttext 0x80030000 -e main long_compare.o -o
long_compare.elf

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