------- Comment #1 from pinskia at gcc dot gnu dot org 2008-08-29 05:27 ------- This spilling also happens on x86-darwin. Note x86-darwin uses -fPIC by default. For PPC it looks like IRA is not looking into REG_EQUAL: We have in the dump right before IRA: (insn:HI 29 26 30 2 gcc/gcc/testsuite/gcc.dg/20020103-1.c:38 (set (reg:DI 3 3) (reg/f:DI 119)) 352 {*movdi_internal64} (expr_list:REG_DEAD (reg/f:DI 119) (expr_list:REG_EQUAL (symbol_ref:DI ("ext") [flags 0xc0] <var_decl 0xf7cca6c0 ext>) (nil))))
So we had spilled reg 119 instead of the re-materialize the address from the REG_EQUAL. x86-darwin looks like a different issue though, but it looks like IRA is not calling targetm.delegitimize_address to get the original address to re-materialize it after the asm. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37273