https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83368
Bug ID: 83368 Summary: alloca after setjmp breaks PIC base reg Product: gcc Version: 7.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: jrtc27 at jrtc27 dot com CC: glaubitz at physik dot fu-berlin.de Target Milestone: --- Target: sparc64-linux-gnu Created attachment 42837 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42837&action=edit Testcase If alloca is used after setjmp in the same function, upon longjmp'ing back, %l7 no longer has the correct value, but the generated code assumes it does, and things break, typically by segfaulting (as in the attached example). It seems this possibility is intended to be covered in sparc.md, as builtin_setjmp_receiver has a call to load_got_register if flag_pic is true. However, for whatever reason this doesn't seem to actually make a difference.