Hello, the attached patch addresses PR 51337. Tested against rev 181782 with:
make -k check RUNTESTFLAGS="--target_board=sh-sim \{-m2/-ml,-m2/-mb,-m2a-single/-mb,-m4-single/-ml,-m4-single/-mb,-m4a-single/-ml,-m4a-single/-mb}" ...with no new failures and 24 unexpected failure fixes for -m2a-single. Cheers, Oleg ChangeLog: 2011-11-29 Oleg Endo <oleg.e...@t-online.de> PR target/51337 * config/sh/sh.c (sh_secondary_reload): Add case when FPUL register is being loaded from a pseudo in memory.
Index: gcc/config/sh/sh.c =================================================================== --- gcc/config/sh/sh.c (revision 181782) +++ gcc/config/sh/sh.c (working copy) @@ -12432,6 +12432,14 @@ if (rclass != GENERAL_REGS && REG_P (x) && TARGET_REGISTER_P (REGNO (x))) return GENERAL_REGS; + + /* If here fall back to loading FPUL register through general registers. + This case can happen when movsi_ie insn is picked initially to + load/store the FPUL register from/to another register, and then the + other register is allocated on the stack. */ + if (rclass == FPUL_REGS && true_regnum (x) == -1) + return GENERAL_REGS; + return NO_REGS; }