public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-4670] Fix minor problem in stack probing
@ 2023-10-16 23:16 Jeff Law
  0 siblings, 0 replies; only message in thread
From: Jeff Law @ 2023-10-16 23:16 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:b626751a4e87b090531c648631df33ac20c4fab8

commit r14-4670-gb626751a4e87b090531c648631df33ac20c4fab8
Author: Jeff Law <jlaw@ventanamicro.com>
Date:   Mon Oct 16 17:14:38 2023 -0600

    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.

Diff:
---
 gcc/explow.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/explow.cc b/gcc/explow.cc
index 6424c0802f07..0c03ac350bbe 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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-10-16 23:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-16 23:16 [gcc r14-4670] Fix minor problem in stack probing Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).