https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55212
Oleg Endo <olegendo at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2014-09-10 Ever confirmed|0 |1 --- Comment #2 from Oleg Endo <olegendo at gcc dot gnu.org> --- I've committed a small change as r215140. In my case building libgcc failed in the function __divsc3 and the change in sh_secondary_reload made it go away. I've briefly compared the resulting code against non-LRA and it looked OK. However, building __divsc3 still fails for -m2 -mb, now with the following: beh 0 0 0 (insn 1159 1008 1120 27 (set (reg:QI 625) (mem/c:QI (plus:SI (reg/f:SI 153 sfp) (const_int 19 [0x13])) [2 %sfp+-1 S1 A8])) sh_tmp.cpp:45 -1 (nil)) sh_tmp.cpp: In function '__divsc3': sh_tmp.cpp:57:1: internal compiler error: in lra_set_insn_recog_data, at lra.c:947 } ^ 0x8524c29 lra_set_insn_recog_data(rtx_def*) ../../gcc-sh-lra/gcc/lra.c:947 0x85258cb lra_get_insn_recog_data ../../gcc-sh-lra/gcc/lra-int.h:468 0x85258cb lra_update_insn_regno_info ../../gcc-sh-lra/gcc/lra.c:1607 0x85258cb lra_update_insn_regno_info ../../gcc-sh-lra/gcc/lra.c:1598 0x8525b1b lra_push_insn_1 ../../gcc-sh-lra/gcc/lra.c:1660 0x8525b1b lra_push_insn(rtx_def*) ../../gcc-sh-lra/gcc/lra.c:1668 0x8525d12 push_insns ../../gcc-sh-lra/gcc/lra.c:1711 0x852618f lra_process_new_insns(rtx_def*, rtx_def*, rtx_def*, char const*) ../../gcc-sh-lra/gcc/lra.c:1756 0x8533758 simplify_operand_subreg ../../gcc-sh-lra/gcc/lra-constraints.c:1523 0x8533758 curr_insn_transform ../../gcc-sh-lra/gcc/lra-constraints.c:3258 0x8535e2d lra_constraints(bool) ../../gcc-sh-lra/gcc/lra-constraints.c:4212 0x8526af8 lra(_IO_FILE*) ../../gcc-sh-lra/gcc/lra.c:2198 0x84e6823 do_reload ../../gcc-sh-lra/gcc/ira.c:5306 0x84e6823 execute ../../gcc-sh-lra/gcc/ira.c:5465 The generated insn 1159 isn't recognized, because the displacement value is out of range. It seems that LRA doesn't try to transform the out of range displacement QImode move into something else so that the <disp04> constraint is satisfied. Maybe this is due to the way I did the QI/HImode displacement patterns. AFAIR, reload uses the macro LEGITIMIZE_RELOAD_ADDRESS (sh_legitimize_reload_address) to handle such cases. LRA can decompose addresses. However, it looks like it's not done in some cases?