aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schulze Frielinghaus <stefansf@gcc.gnu.org>2025-07-24 12:03:43 +0200
committerH.J. Lu <hjl.tools@gmail.com>2025-09-13 05:19:10 -0700
commitf8b6f1d83ba8fd4186100e1e357ba7eb8124bdb7 (patch)
treed6aeccff7449f8cc467a1dc899db3e8c94dc1d70
parent205b5a5741875c7435facb706a15f1410338a4e0 (diff)
downloadgcc-f8b6f1d83ba8fd4186100e1e357ba7eb8124bdb7.zip
gcc-f8b6f1d83ba8fd4186100e1e357ba7eb8124bdb7.tar.gz
gcc-f8b6f1d83ba8fd4186100e1e357ba7eb8124bdb7.tar.bz2
lra: Stop constraint processing on error [PR121205]
It looks like we didn't have a test so far reaching this point which changed with the new hard register constraint tests. Bootstrap and regtest are still running on x86_64. If they succeed, ok for mainline? -- >8 -- As noted by Sam in the PR, with checking enabled tests gcc.target/i386/asm-hard-reg-{1,2}.c fail with an ICE. If an error is detected in curr_insn_transform(), lra_asm_insn_error() is called and deletes the current insn. However, afterwards processing continues with the deleted insn and via lra_process_new_insns() we finally call recog() for NOTE_INSN_DELETED which ICEs in case of a checking build. Thus, in case of an error during curr_insn_transform() bail out and stop processing. gcc/ChangeLog: PR rtl-optimization/121205 * lra-constraints.cc (curr_insn_transform): Stop processing on error.
-rw-r--r--gcc/lra-constraints.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/lra-constraints.cc b/gcc/lra-constraints.cc
index aa3962b..b152997 100644
--- a/gcc/lra-constraints.cc
+++ b/gcc/lra-constraints.cc
@@ -4930,7 +4930,10 @@ curr_insn_transform (bool check_only_p)
if (asm_noperands (PATTERN (curr_insn)) >= 0
&& ++curr_id->asm_reloads_num >= FIRST_PSEUDO_REGISTER)
/* Most probably there are no enough registers to satisfy asm insn: */
- lra_asm_insn_error (curr_insn);
+ {
+ lra_asm_insn_error (curr_insn);
+ return change_p;
+ }
}
if (goal_alt_out_sp_reload_p)
{