https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120165

--- Comment #15 from Mikael Pettersson <mikpelinux at gmail dot com> ---
The lost REG_ARGS_SIZE note seems to be a regression from PR120169:

@@ -1983,6 +1983,25 @@ lra_process_new_insns (rtx_insn *insn, rtx_insn *before,
rtx_insn *after,
          emit_insn_after (after, insn);
          push_insns (last, insn);
          setup_sp_offset (after, last);
+         if (fixup_reg_args_size)
+           {
+             rtx note = find_reg_note (insn, REG_ARGS_SIZE, NULL_RTX);
+             if (note)
+               {
+                 remove_note (insn, note);
+                 fixup_args_size_notes (insn, last,
+                                        get_args_size (note));

fixup_args_size_notes will update the notes from last back to but EXCLUDING
insn. That is, insn will unconditionally lose its note. Passing PREV_INSN
(insn) instead resurrects the lost note.

However, this fix does not change the bogus offset in the output reload
inserted after the push. It seems the output reload is constructed without
taking the side-effect of the push into account.

Reply via email to