[PR 60580, AArch64] Fix __attribute__ ((optimize("no-omit-frame-pointer")))
commit743de8ed93b48297eb34a8c00e663f1425e874dd
authormshawcroft <mshawcroft@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 27 Mar 2014 10:13:50 +0000 (27 10:13 +0000)
committermshawcroft <mshawcroft@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 27 Mar 2014 10:13:50 +0000 (27 10:13 +0000)
treeb37b071828298af9a484d41c16d102e23e430568
parent0bc23e2b01de030683d65e27a539ec169b25e2c6
[PR 60580, AArch64] Fix __attribute__ ((optimize("no-omit-frame-pointer")))

The implementation of -m[no-]omit-leaf-frame-pointer and
-f[no-]omit-frame-pointer in the AArch64 target does not behave
correctly in the presence of __attribute__ optimize.

This patch adjusts the implementation to work in a similar fashion to
the same functionality in the i386 target.

The problem occurs because the current implementation uses a global
'faked_omit_frame_pointer' to retain the original value of
flag_omit_frame_pointer.  The global does not form part of the
optimization save state.

This solution removes the global and instead tracks required behaviour
using only flag_omit_frame_pointer and flag_omit_leaf_frame_pointer.
These two form part of the optimziation save state and target save
state respectively.

The additional complication for AArch64 is that the PCS requires that
given -fno-omit-frame-pointer -momit-leave-frame-pointer, a leaf
function that kills LR must create a frame record.  This is readily
handled in aarch64_frame_pointer_required().  I've dropped logic in
aarch64_can_eliminate() that attempts to detect this scenario since it

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208862 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/aarch64/aarch64.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/pr60580_1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/test_fp_attribute_1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/test_fp_attribute_2.c [new file with mode: 0644]