]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[PR123092, LRA]: Reprocess insn after equivalence substitution
authorVladimir N. Makarov <vmakarov@redhat.com>
Fri, 16 Jan 2026 15:09:52 +0000 (10:09 -0500)
committerVladimir N. Makarov <vmakarov@redhat.com>
Fri, 16 Jan 2026 15:12:34 +0000 (10:12 -0500)
LRA in the test case substituted equivalence in an insn but did not
process the insn on satisfying constraints after that.  It resulted in
error "insn does not satisfy its constraints"

gcc/ChangeLog:

PR target/123092
* lra-constraints.cc (lra_constraints): Push insn on processing
stack after equivalence substitution.

gcc/testsuite/ChangeLog:

PR target/123092
* gcc.target/riscv/pr123092.c: New.

gcc/lra-constraints.cc
gcc/testsuite/gcc.target/riscv/pr123092.c [new file with mode: 0644]

index ba7342f3ed27c1ed583f3bc10da6f6afbd13458e..e3cee94724313133851021e13819f3e8c3359f61 100644 (file)
@@ -5664,6 +5664,7 @@ lra_constraints (bool first_p)
                   && loc_equivalence_change_p (&PATTERN (curr_insn)))
            {
              lra_update_insn_regno_info (curr_insn);
+             lra_push_insn_by_uid (INSN_UID (curr_insn));
              changed_p = true;
            }
        }
diff --git a/gcc/testsuite/gcc.target/riscv/pr123092.c b/gcc/testsuite/gcc.target/riscv/pr123092.c
new file mode 100644 (file)
index 0000000..ebcf177
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=rv64gc_zicbop -mabi=lp64d" } */
+struct a {
+  char *b;
+} d;
+int e;
+int c(struct a *);
+void f() {
+  __builtin_prefetch(d.b + 64);
+  if (e)
+    c(&d);
+}