[Bug middle-end/60580] aarch64 generates wrong code for __attribute__ ((optimize("no-omit-frame-pointer")))
wilco at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Oct 24 16:58:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60580
--- Comment #9 from Wilco <wilco at gcc dot gnu.org> ---
Author: wilco
Date: Tue Oct 24 16:58:02 2017
New Revision: 254052
URL: https://gcc.gnu.org/viewcvs?rev=254052&root=gcc&view=rev
Log:
PR60580: Fix frame pointer option magic
To fix PR60580 simplify the logic in aarch64_override_options_after_change_1
().
If the frame pointer is enabled, set it to a special value that behaves similar
to frame pointer omission. If we don't do this all leaf functions will get a
frame pointer even if flag_omit_leaf_frame_pointer is set.
If flag_omit_frame_pointer has this special value, we must force the frame
pointer if not in a leaf function. We also need to force it in a leaf function
if flag_omit_frame_pointer is not set or if LR is used.
Doing this allows both -fomit-frame-pointer and -fomit-leaf-frame-pointer to be
independently set and changed in each function with the expected behaviour.
gcc/
PR middle-end/60580
* config/aarch64/aarch64.c (aarch64_frame_pointer_required)
Check special value of flag_omit_frame_pointer.
(aarch64_can_eliminate): Likewise.
(aarch64_override_options_after_change_1): Simplify handling of
-fomit-frame-pointer and -fomit-leaf-frame-pointer.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/aarch64/aarch64.c
More information about the Gcc-bugs
mailing list