[LLVMbugs] [Bug 5031] New: Invalid offset folding

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Sep 22 16:43:00 PDT 2009


           Summary: Invalid offset folding
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Common Code Generator Code
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: asl at math.spbu.ru
                CC: llvmbugs at cs.uiuc.edu

Created an attachment (id=3545)
 --> (http://llvm.org/bugs/attachment.cgi?id=3545)

Consider the attached testcase. Let us compare the two outputs:

1. ./llc 1.bc -mcpu=cortex-a9 -soft-float -asm-verbose=0 -o good.s
2. ./llc 1.bc -mcpu=cortex-a9 -soft-float -asm-verbose=0
-relocation-model=static bad.s

--- good.s      2009-09-23 03:35:50.000000000 +0400
+++ bad.s       2009-09-23 03:35:40.000000000 +0400
@@ -14,7 +14,6 @@
        stmfd sp!, {r4, lr}
        ldr r1, .LCPI1_0
-       add r1, r1, #8
        str r1, [r0]
        ldr r1, [r0, #+476]
        mov r4, r0

The difference is caused by the fact that we're not overriding default
relocation model on ARM (this is separate bug, I will take care of it after
this one will be fixed). This leads to different behaviour of
TargetLowering::isOffsetFoldingLegal(): always true to static relocation model
and false for default.

It seems that folded offset is somehow not honored later which leads to invalid

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