diff options
author | Ian Bolton <ian.bolton@arm.com> | 2013-05-02 17:00:00 +0000 |
---|---|---|
committer | Ian Bolton <ian.bolton@arm.com> | 2013-05-02 17:00:00 +0000 |
commit | ce4a1dabe1e5791e699383a01a21d739c1191d7c (patch) | |
tree | f2f4e1da0f0c1eaa959beeb5d5ee0d2c26092727 /gcc/config | |
parent | 620247cf2b0684dd36053ea2f6fd661c16d90073 (diff) |
Backport of AArch64 -fomit-frame-pointer fix
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@198551 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/aarch64/aarch64.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 41537631ea0..4166782b80f 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -3881,14 +3881,21 @@ aarch64_can_eliminate (const int from, const int to) } else { - /* If we decided that we didn't need a frame pointer but then used - LR in the function, then we do need a frame pointer after all, so - prevent this elimination to ensure a frame pointer is used. */ - + /* If we decided that we didn't need a leaf frame pointer but then used + LR in the function, then we'll want a frame pointer after all, so + prevent this elimination to ensure a frame pointer is used. + + NOTE: the original value of flag_omit_frame_pointer gets trashed + IFF flag_omit_leaf_frame_pointer is true, so we check the value + of faked_omit_frame_pointer here (which is true when we always + wish to keep non-leaf frame pointers but only wish to keep leaf frame + pointers when LR is clobbered). */ if (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM - && df_regs_ever_live_p (LR_REGNUM)) + && df_regs_ever_live_p (LR_REGNUM) + && faked_omit_frame_pointer) return false; } + return true; } |