[llvm-bugs] [Bug 24560] New: arm assembler does not share constant pool

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Aug 24 14:11:19 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=24560

            Bug ID: 24560
           Summary: arm assembler does not share constant pool
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: Cell SPU
          Assignee: unassignedbugs at nondot.org
          Reporter: chh at google.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Arm target assembler should share constants in the constant pool.

Input:  x.s

    .arm
    .text
    .global foo1
foo1:
    PUSH {r4-r6,lr}
    LDR r7, =0x80808080
    LDR r7, =0x80808080
    POP {r4-r6,pc}
    .global foo2
foo2:
    PUSH {r4-r6,lr}
    LDR r7, =0x80808080
    POP {r4-r6,pc}
    .global foo3
    .end

Compile with:

clang -target arm-linux-gnu -c -o x.o x.s


Objdump showed 3 instances of the constant 0x80808080:

00000000 <foo1>:
   0:   e92d4070    push    {r4, r5, r6, lr}
   4:   e59f7010    ldr r7, [pc, #16]   ; 1c <foo2+0xc>
   8:   e59f7010    ldr r7, [pc, #16]   ; 20 <foo2+0x10>
   c:   e8bd8070    pop {r4, r5, r6, pc}

00000010 <foo2>:
  10:   e92d4070    push    {r4, r5, r6, lr}
  14:   e59f7008    ldr r7, [pc, #8]    ; 24 <foo2+0x14>
  18:   e8bd8070    pop {r4, r5, r6, pc}
  1c:   80808080    addhi   r8, r0, r0, lsl #1
  20:   80808080    addhi   r8, r0, r0, lsl #1
  24:   80808080    addhi   r8, r0, r0, lsl #1

-- 
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/20150824/f858a39d/attachment.html>


More information about the llvm-bugs mailing list