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

            Bug ID: 16393
           Summary: lencod miscompiled on Cortex-A15 (byval issue)
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: ARM
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]
    Classification: Unclassified

Created attachment 10717
  --> http://llvm.org/bugs/attachment.cgi?id=10717&action=edit
the miscompiled function

MultiSource/Applications/JM/lencod has been failing on the arm-lnt buildbot
since r184105. After some investigation it looks like this is caused by broken
byval handling, r184105 only changed spilling decisions and uncovered the
issue.

Attached is IR for the miscompiled function (compile with llc
-mcpu=cortex-a15). It passes a very large object byval. Of particular interest
is the part:

    mov    r0, #1
    mov    r1, #2
    bl    RestoreMVBlock8x8
    add    sp, sp, #24
    add    sp, sp, #8192
    sub    sp, sp, #24
    sub    sp, sp, #8192
    ldm    r10, {r2, r3}
    mov    r1, sp
    str    r6, [sp, r8]
    ldr    r0, .LCPI0_0
.LBB0_57:                               @ %if.then248
                                        @ =>This Inner Loop Header: Depth=1
    ldr    r7, [r5], #4
    subs    r0, r0, #4
    str    r7, [r1], #4
    bne    .LBB0_57
@ BB#58:                                @ %if.then248
    mov    r0, #1
    mov    r1, #3
    bl    RestoreMVBlock8x8
    add    sp, sp, #24
    add    sp, sp, #8192
    sub    lr, sp, #4096
    sub    r0, sp, #4096
    ldr    r3, [lr, #-4084]        @ 4-byte Reload
    movw    r5, :lower16:img
    ldr    r12, [r0, #-4068]       @ 4-byte Reload

The upper part just looks inefficient, after the second part we end up with a
corrupted stack.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to