From: Vladimir N. Makarov Date: Mon, 14 Aug 2023 20:06:27 +0000 (-0400) Subject: [LRA]: Process output stack pointer reloads before emitting reload insns X-Git-Tag: basepoints/gcc-15~6930 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=882ee2ca4d313ebeb40aee53186beb670e1f4573;p=thirdparty%2Fgcc.git [LRA]: Process output stack pointer reloads before emitting reload insns Previous patch setting up asserts for processing stack pointer reloads caught an error in code moving sp offset. This resulted in failure of building aarch64 port. The code wrongly processed insns beyond the output reloads of the current insn. This patch fixes it. gcc/ChangeLog: * lra-constraints.cc (curr_insn_transform): Process output stack pointer reloads before emitting reload insns. --- diff --git a/gcc/lra-constraints.cc b/gcc/lra-constraints.cc index 8d9443adeb64..c718bedff32a 100644 --- a/gcc/lra-constraints.cc +++ b/gcc/lra-constraints.cc @@ -4840,7 +4840,6 @@ curr_insn_transform (bool check_only_p) /* Most probably there are no enough registers to satisfy asm insn: */ lra_asm_insn_error (curr_insn); } - lra_process_new_insns (curr_insn, before, after, "Inserting insn reload"); if (goal_alt_out_sp_reload_p) { /* We have an output stack pointer reload -- update sp offset: */ @@ -4863,6 +4862,7 @@ curr_insn_transform (bool check_only_p) } lra_assert (done_p); } + lra_process_new_insns (curr_insn, before, after, "Inserting insn reload"); return change_p; }