https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87373

--- Comment #17 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
(In reply to Murat Ursavaş from comment #16)
> OK I understand conservative action and not wait for word by word access.
> But the resulting value is not 0x401 on the test case, but it should be.

Is not 0x401 at what point?  This part of the sequence:

        ldr     r3, .L3        < &testStructPtr
        ldr     r3, [r3]       < testStructPtr
        ldrb    r2, [r3]       < testStructPtr->one[byte 0] (dead)
        movs    r2, #0         < 0
        orr     r2, r2, #1     < 1
        strb    r2, [r3]       < testStructPtr->one[byte 0] = 0x01
        ldrb    r2, [r3, #1]   < testStructPtr->one[byte 1] (dead)
        movs    r2, #0         < 0
        orr     r2, r2, #4     < 4
        strb    r2, [r3, #1]   < testStructPtr->one[byte 1] = 0x04
        ldrb    r2, [r3, #2]
        movs    r2, #0
        strb    r2, [r3, #2]   < testStructPtr->one[byte 2] = 0x00
        ldrb    r2, [r3, #3]
        movs    r2, #0
        strb    r2, [r3, #3]   < testStructPtr->one[byte 3] = 0x00

so successive bytes starting at &(testStructPtr->one) contain 0x01, 0x04, 0x00,
0x00 which is the value in the source code.

Reply via email to