i386: Don't use frame pointer without stack access
authorH.J. Lu <hongjiu.lu@intel.com>
Mon, 7 Aug 2017 11:49:10 +0000 (11:49 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Mon, 7 Aug 2017 11:49:10 +0000 (04:49 -0700)
commit079a03638c5c38918f608c496ca1032a9ddc26c9
tree8789d79f13ef45850fab00accf16b4d49977cbf9
parent356512c0660a1f549c48128ab63cc56077d05db2
i386: Don't use frame pointer without stack access

When there is no stack access, there is no need to use frame pointer
even if -fno-omit-frame-pointer is used.

gcc/

PR target/81736
* config/i386/i386.c (ix86_finalize_stack_realign_flags): Renamed
to ...
(ix86_finalize_stack_frame_flags): This.  Also clear
frame_pointer_needed if -fno-omit-frame-pointer is used without
stack access.
(ix86_expand_prologue): Replace ix86_finalize_stack_realign_flags
with ix86_finalize_stack_frame_flags.
(ix86_expand_epilogue): Likewise.
(ix86_expand_split_stack_prologue): Likewise.

gcc/testsuite/

PR target/81736
* gcc.target/i386/pr81736-1.c: New test.
* gcc.target/i386/pr81736-2.c: Likewise.
* gcc.target/i386/pr81736-3.c: Likewise.
* gcc.target/i386/pr81736-4.c: Likewise.

From-SVN: r250916
gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr81736-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr81736-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr81736-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr81736-4.c [new file with mode: 0644]