]> git.ipfire.org Git - thirdparty/gcc.git/commit
strub: sparc64: unbias the stack address [PR112917]
authorAlexandre Oliva <oliva@adacore.com>
Thu, 14 Dec 2023 07:50:45 +0000 (04:50 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Wed, 20 Dec 2023 08:18:21 +0000 (05:18 -0300)
commit4e0a467302fea56d63b7a6d17f99c0f388960dc7
tree0cdaf393c2c5e6b0b69f02d5ce48e8675155c8b9
parent9fa35dbb901b11d31a897cc88c9258e7cd35b899
strub: sparc64: unbias the stack address [PR112917]

The stack pointer is biased by 2047 bytes on sparc64, so the range it
delimits is way off.  Unbias the addresses returned by
__builtin_stack_address (), so that the strub builtins, inlined or
not, can function correctly.  I've considered introducing a new target
macro, but using STACK_POINTER_OFFSET seems safe, and it enables the
register save areas to be scrubbed as well.

Because of the large fixed-size outgoing args area next to the
register save area on sparc, we still need __strub_leave to not
allocate its own frame, otherwise it won't be able to clear part of
the frame it should.

for  gcc/ChangeLog

PR middle-end/112917
* builtins.cc (expand_bultin_stack_address): Add
STACK_POINTER_OFFSET.
* doc/extend.texi (__builtin_stack_address): Adjust.
gcc/builtins.cc
gcc/doc/extend.texi