This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/84521] [8 Regression] aarch64: Frame-pointer corruption with __builtin_setjmp/__builtin_longjmp and -fomit-frame-pointer
- From: "wilco at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 22 Feb 2018 19:55:41 +0000
- Subject: [Bug target/84521] [8 Regression] aarch64: Frame-pointer corruption with __builtin_setjmp/__builtin_longjmp and -fomit-frame-pointer
- Auto-submitted: auto-generated
- References: <bug-84521-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84521
--- Comment #6 from Wilco <wilco at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #5)
> (completely untested) would require frame pointers for all setjmp calls, not
> just __builtin_setjmp.
That's the correct approach indeed, however aarch64_frame_pointer_required is
no longer used, this now needs to added to aarch64_layout_frame:
/* Force a frame chain for EH returns so the return address is at FP+8. */
cfun->machine->frame.emit_frame_chain
= frame_pointer_needed || crtl->calls_eh_return;
> BTW, does __builtin_return_address really work on aarch64 without frame
> pointers? Various other targets require frame pointers when
> cfun->machine->access_prev_frame (i.e. when SETUP_FRAME_ADDRESSES () has
> been used).
It only supports returning the return address of the current function (and even
that is most likely a bug rather than useful). When level != 0 it always
returns 0.