gcc 2.7.2.3 bug, ARM target -

amolitor@visi.com amolitor@visi.com
Thu Dec 16 19:15:00 GMT 1999


	If I have this code:


id
A(tag)
unsigned short  tag;
{
        bar(tag);
}


	and compile is with 'gcc -S foo.c', the resulting .s file
will contain:

_A:
        @ args = 0, pretend = 0, frame = 4
        @ frame_needed = 1, current_function_anonymous_args = 0
        mov     ip, sp
        stmfd   sp!, {r4, r5, fp, ip, lr, pc}
        sub     fp, ip, #4
        sub     sp, sp, #4
        mov     r4, r0
        strb    r4, [fp, #-22]
        mov     r5, r4, asr #8
        strb    r5, [fp, #-21]
        ldr     r3, [fp, #-22]  @ movhi   BUSTED. Misaligned load. BOOM.
        mov     r2, r3, asl #16
        mov     r3, r2, lsr #16
        mov     r0, r3
        bl      _bar
L1:
        ldmea   fp, {r4, r5, fp, sp, pc}^


	No offense, but how the hell did this ARM back end escape into
the world? It's unusably bad, even trivial testing should have turned
these things up.

	Thanks,

		Andrew Molitor


More information about the Gcc-bugs mailing list