aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Law <jlaw@ventanamicro.com>2023-10-16 17:14:38 -0600
committerJeff Law <jlaw@ventanamicro.com>2023-10-16 17:16:12 -0600
commitb626751a4e87b090531c648631df33ac20c4fab8 (patch)
tree7afd40c2c81c97f46b08ed1e830cf6409d1591f3
parent04013e4464020b4440aa41524a222658d7e36937 (diff)
downloadgcc-b626751a4e87b090531c648631df33ac20c4fab8.zip
gcc-b626751a4e87b090531c648631df33ac20c4fab8.tar.gz
gcc-b626751a4e87b090531c648631df33ac20c4fab8.tar.bz2
Fix minor problem in stack probing
probe_stack_range has an assert to capture the possibility that that expand_binop might not construct its result in the provided target. We triggered that internally a little while ago. I'm pretty sure it was in the testsuite, so no new testcase. The fix is easy, copy the result into the proper target when needed. Bootstrapped and regression tested on x86. gcc/ * explow.cc (probe_stack_range): Handle case when expand_binop does not construct its result in the expected location.
-rw-r--r--gcc/explow.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/explow.cc b/gcc/explow.cc
index 6424c08..0c03ac3 100644
--- a/gcc/explow.cc
+++ b/gcc/explow.cc
@@ -1818,7 +1818,10 @@ probe_stack_range (HOST_WIDE_INT first, rtx size)
gen_int_mode (PROBE_INTERVAL, Pmode), test_addr,
1, OPTAB_WIDEN);
- gcc_assert (temp == test_addr);
+ /* There is no guarantee that expand_binop constructs its result
+ in TEST_ADDR. So copy into TEST_ADDR if necessary. */
+ if (temp != test_addr)
+ emit_move_insn (test_addr, temp);
/* Probe at TEST_ADDR. */
emit_stack_probe (test_addr);