The following patch fixes useless asserts in my latest patch
implementing output stack pointer reloads.
commit 18b417fe1a46d37738243267c1f559cd0acc4886
Author: Vladimir N. Makarov <vmaka...@redhat.com>
Date: Sun Aug 13 20:54:58 2023 -0400
[LRA]: Fix asserts for output stack pointer reloads
The patch implementing output stack pointer reloads contained superfluous
asserts. The patch makes them useful.
gcc/ChangeLog:
* lra-constraints.cc (curr_insn_transform): Set done_p up and
check it on true after processing output stack pointer reload.
diff --git a/gcc/lra-constraints.cc b/gcc/lra-constraints.cc
index 26239908747..8d9443adeb6 100644
--- a/gcc/lra-constraints.cc
+++ b/gcc/lra-constraints.cc
@@ -4852,6 +4852,7 @@ curr_insn_transform (bool check_only_p)
&& SET_DEST (set) == stack_pointer_rtx)
{
lra_assert (!done_p);
+ done_p = true;
curr_id->sp_offset = 0;
lra_insn_recog_data_t id = lra_get_insn_recog_data (insn);
id->sp_offset = sp_offset;
@@ -4860,7 +4861,7 @@ curr_insn_transform (bool check_only_p)
" Moving sp offset from insn %u to %u\n",
INSN_UID (curr_insn), INSN_UID (insn));
}
- lra_assert (!done_p);
+ lra_assert (done_p);
}
return change_p;
}