aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.cc
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2024-01-31 00:13:36 -0300
committerAlexandre Oliva <oliva@gnu.org>2024-01-31 00:22:11 -0300
commit320fb976e933e8892af905e68de65492568f2a49 (patch)
treea5f06afdd5f0392a7ddf25e2ee4f210b6ac06ff9 /gcc/builtins.cc
parent35de88e2ed0aa78f6e3306c8560cd6bb15ce0ffe (diff)
downloadgcc-320fb976e933e8892af905e68de65492568f2a49.zip
gcc-320fb976e933e8892af905e68de65492568f2a49.tar.gz
gcc-320fb976e933e8892af905e68de65492568f2a49.tar.bz2
0From: Alexandre Oliva <oliva@adacore.com>
strub: introduce STACK_ADDRESS_OFFSET Since STACK_POINTER_OFFSET is not necessarily at the boundary between caller- and callee-owned stack, as desired by __builtin_stack_address(), and using it as if it were or not causes problems, introduce a new macro so that ports can define it suitably, without modifying STACK_POINTER_OFFSET. for gcc/ChangeLog PR middle-end/112917 PR middle-end/113100 * builtins.cc (expand_builtin_stack_address): Use STACK_ADDRESS_OFFSET. * doc/extend.texi (__builtin_stack_address): Adjust. * config/sparc/sparc.h (STACK_ADDRESS_OFFSET): Define. * doc/tm.texi.in (STACK_ADDRESS_OFFSET): Document. * doc/tm.texi: Rebuilt.
Diffstat (limited to 'gcc/builtins.cc')
-rw-r--r--gcc/builtins.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/builtins.cc b/gcc/builtins.cc
index a0bd82c..1d54ea0 100644
--- a/gcc/builtins.cc
+++ b/gcc/builtins.cc
@@ -5450,7 +5450,7 @@ expand_builtin_stack_address ()
rtx ret = convert_to_mode (ptr_mode, copy_to_reg (stack_pointer_rtx),
STACK_UNSIGNED);
-#ifdef SPARC_STACK_BOUNDARY_HACK
+#ifdef STACK_ADDRESS_OFFSET
/* Unbias the stack pointer, bringing it to the boundary between the
stack area claimed by the active function calling this builtin,
and stack ranges that could get clobbered if it called another
@@ -5477,8 +5477,7 @@ expand_builtin_stack_address ()
(caller) function's active area as well, whereas those pushed or
allocated temporarily for a call are regarded as part of the
callee's stack range, rather than the caller's. */
- if (SPARC_STACK_BOUNDARY_HACK)
- ret = plus_constant (ptr_mode, ret, STACK_POINTER_OFFSET);
+ ret = plus_constant (ptr_mode, ret, STACK_ADDRESS_OFFSET);
#endif
return force_reg (ptr_mode, ret);