This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/83368] alloca after setjmp breaks PIC base reg


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83368

--- Comment #9 from James Clarke <jrtc27 at jrtc27 dot com> ---
(In reply to Eric Botcazou from comment #7)
> > And for what it's worth, 32-bit Solaris/SPARC's setjmp isn't saving any of
> > the caller's input or local registers either, so it's not glibc-specific.
> 
> Again you're wrong, the call-saved registers are properly preserved if you
> don't clobber the stack pointer, just write a small test or simply tweak
> yours.

Yes, I know that. But GCC doesn't rely on that for *any other use* of the input
and local registers; they are spilled to the stack and reloaded after the
setjmp when needed. Also the fact that alloca clobbers the stack pointer is an
implementation detail; for example, LLVM allocates all the space up front in
the function prologue in this case, which means it would not run into this
issue (and in fact it also spills its PIC base register).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]