------- Comment #6 from sandra at codesourcery dot com  2009-08-24 22:36 -------
This bug appears to be fixed in mainline HEAD now.  Here's an excerpt showing
the generated code for the inner loop in the example program now:

        addiu   $21,$28,%gp_rel(AA)
        addiu   $10,$28,%gp_rel(A)
        addiu   $20,$28,%gp_rel(BB)
        addiu   $9,$28,%gp_rel(B)
        li      $19,2044                        # 0x7fc
        li      $18,10                  # 0xa
        move    $2,$0
.L3:
        addu    $8,$10,$2
        addu    $3,$9,$2
        lw      $24,0($8)
        addu    $14,$21,$2
        lw      $8,0($3)
        addu    $3,$20,$2
        addiu   $2,$2,4
        sw      $24,0($14)
        bne     $2,$19,.L3
        sw      $8,0($3)

All 4 gp_rel address computations pulled outside the loop, and only 5 adds
inside.  I'm not sure what fixed this, but it does seem fixed.


-- 

sandra at codesourcery dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WORKSFORME


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

Reply via email to