------- Comment #26 from chrbr at gcc dot gnu dot org  2010-02-01 16:30 -------
I'm afraid the unaligned access sigbug regression is another latent bug just
exhibited by the fix for the original PR :-(

what happens is the the GOT loading sequence is broken by a constant pool:

we end up to emit:

        mov.l   .L542,r12    (X)
        bra     .L516
        nop
.L542:
       .align 2
        .long   _GLOBAL_OFFSET_TABLE_
       ...
.L516:
        mova    .L545,r0   (Y) !!!!!
        add     r0,r12
.L545:
        .long   _GLOBAL_OFFSET_TABLE_

The reason for that is that the second mova instruction is unluckily now out of
range by 2 bytes. (which could happen with any other situation, even without
this patch).

IMHO We should forbid the duplication of a _GLOBAL_OFFSET_TABLE_ loading
constant while in a UNSPEC_MOVA sequence.

We should probably reduce si_limit in find_barrier when a 
(set (reg:SI 0 r0)
        (unspec:SI [
                (const:SI (unspec:SI [
                            (symbol_ref ("*_GLOBAL_OFFSET_TABLE_"))
is met and next is
 (set (reg:SI 12 r12)
        (const:SI (unspec:SI [
                    (symbol_ref ("*_GLOBAL_OFFSET_TABLE_") 

in PIC.

I experimenting with a couple of different solutions in this direction.

this PR was a really interesting bugs finder.... !


-- 


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

Reply via email to