------- Comment #3 from carrot at google dot com  2009-06-15 02:26 -------
Created an attachment (id=17998)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17998&action=view)
preprocessed test case

A possible code sequence without spilling is:

        push    {r4, r5, r6, r7, lr}
        add     r6, r1, r2
        mov     r4, r0
        lsl     r7, r2, 1     // New
        add     r0, r0, r7    // New
        .loc 1 8 0
        b       .L2
.L5:
        .loc 1 10 0
        mov     r7, #0
        ldrsh   r5, [r4, r7]
        .loc 1 12 0
        cmp     r2, r5
        bge     .L3
        .loc 1 14 0
        ldrb    r7, [r1]
        strb    r7, [r1, r2]
        .loc 1 15 0
        strh    r2, [r4]
        .loc 1 16 0
        lsl     r1, r2, #1
        sub     r2, r5, r2
        strh    r2, [r1, r4]
.L6:
        .loc 1 5 0
        b       .L4
.L3:
        .loc 1 19 0
        lsl     r7, r5, #1
        mov     ip, r7
        add     r4, r4, ip
        .loc 1 20 0
        add     r1, r1, r5
        .loc 1 21 0
        sub     r2, r2, r5
.L2:
        .loc 1 8 0
        cmp     r2, #0
        bgt     .L5
        b       .L6
.L4:
        .loc 1 30 0
        mov     r1, #0


-- 

carrot at google dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #17983|0                           |1
        is obsolete|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40416

Reply via email to