The following code has been added to s390_decompose_address for the LRA enablement to prevent strict displacement checking for addresses including eliminable registers. Only during LRA execution the displacements are expected to be valid. 199754 vmakarov if (lra_in_progress 199754 vmakarov || (base != arg_pointer_rtx 199754 vmakarov && indx != arg_pointer_rtx 199754 vmakarov && base != return_address_pointer_rtx 199754 vmakarov && indx != return_address_pointer_rtx 199754 vmakarov && base != frame_pointer_rtx 199754 vmakarov && indx != frame_pointer_rtx 199754 vmakarov && base != virtual_stack_vars_rtx 199754 vmakarov && indx != virtual_stack_vars_rtx)) However, with: Author: law Date: Wed Nov 20 18:17:49 2013 New Revision: 205136 URL: http://gcc.gnu.org/viewcvs?rev=205136&root=gcc&view=rev Log: * lra.c (lra): Set lra_in_progress before check_rtl call. * recog.c (insn_invalid_p): Add !lra_in_progress to prevent adding clobber regs when LRA is running Modified: trunk/gcc/ChangeLog trunk/gcc/lra.c trunk/gcc/recog.c the lra_in_progress = 1; statement has been moved before the initial LRA check_rtl invokation so s390_decompose_address now expects the displacements to be valid already what obviously is not the case. This leads to a bootstrap failure: /home/andreas/patched/gcc-head/libgcc/libgcc2.c: In function ‘__mulsc3’: /home/andreas/patched/gcc-head/libgcc/libgcc2.c:1932:1: error: insn does not satisfy its constraints: } ^ (insn 21 26 23 2 (set (mem/c:SF (plus:DI (reg/f:DI 34 %fp) (const_int -16 [0xfffffffffffffff0])) [2 ac+0 S4 A64]) (reg:SF 108 [ D.5596 ])) /home/andreas/patched/gcc-head/libgcc/libgcc2.c:1874 88 {movsf} (expr_list:REG_DEAD (reg:SF 108 [ D.5596 ]) (nil))) /home/andreas/patched/gcc-head/libgcc/libgcc2.c:1932:1: internal compiler error: in check_rtl, at lra.c :2043 It can easily be reproduced with: cc1 -O0 t.c t.c: void foo (int a) {}
Perhaps we want a different flag for the recog call than lra_in_progress?
(In reply to Jakub Jelinek from comment #1) > Perhaps we want a different flag for the recog call than lra_in_progress? Or don't use it all, it is too heavy. It is better to use something light. I added this code on early stages of LRA development because it is hard to predict what RTL could be. Most important check before was one on addresses and it is gone. Insn_invalid_p check is just a paranoid check. If something goes wrong, the current LRA catches it later in any case. I hope to fix it today.
Author: vmakarov Date: Fri Nov 29 20:08:38 2013 New Revision: 205541 URL: http://gcc.gnu.org/viewcvs?rev=205541&root=gcc&view=rev Log: 2013-11-29 Vladimir Makarov <vmakarov@redhat.com> PR rtl-optimization/59340 * lra.c (check_rtl): Use recog_memoized instead of insn_invalid_p. Revert 2013-11-20 Robert Suchanek <Robert.Suchanek@imgtec.com> * lra.c (lra): Set lra_in_progress before check_rtl call. * recog.c (insn_invalid_p): Add !lra_in_progress to prevent adding clobber regs when LRA is running. Modified: trunk/gcc/ChangeLog trunk/gcc/lra.c trunk/gcc/recog.c
Andreas, could you check that the bootstrap is fixed. At least, the test is compiled by the cross-compiler.
Bootstrap works again with r205541. Thanks!