diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2019-05-22 18:53:37 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2019-05-22 11:53:37 -0700 |
commit | c2080a1fb549a99d567ff6834e06163fb883bf54 (patch) | |
tree | d22718b9405e0484f17f6470ef6f978b020b76bc /gcc/json.h | |
parent | 586e53e269d04c2806f0f6bb6a1aa5db81efc0d4 (diff) | |
download | gcc-c2080a1fb549a99d567ff6834e06163fb883bf54.zip gcc-c2080a1fb549a99d567ff6834e06163fb883bf54.tar.gz gcc-c2080a1fb549a99d567ff6834e06163fb883bf54.tar.bz2 |
x86: Don't allocate stack frame nor align stack if not needed
get_frame_size () returns used stack slots during compilation, which
may be optimized out later. This patch does the followings:
1. Add stack_frame_required to machine_function to indicate that the
function needs a stack frame.
2. Change ix86_find_max_used_stack_alignment to set stack_frame_required.
3. Always call ix86_find_max_used_stack_alignment to check if stack
frame is needed.
Tested on i686 and x86-64 with
--with-arch=native --with-cpu=native
Tested on AVX512 machine configured with
--with-arch=native --with-cpu=native
gcc/
PR target/88483
* config/i386/i386-options.c (ix86_init_machine_status): Set
stack_frame_required to true.
* config/i386/i386.c (ix86_get_frame_size): New function.
(ix86_frame_pointer_required): Replace get_frame_size with
ix86_get_frame_size.
(ix86_compute_frame_layout): Likewise.
(ix86_find_max_used_stack_alignment): Changed to void. Set
stack_frame_required.
(ix86_finalize_stack_frame_flags): Always call
ix86_find_max_used_stack_alignment. Replace get_frame_size with
ix86_get_frame_size.
* config/i386/i386.h (machine_function): Add stack_frame_required.
gcc/testsuite/
PR target/88483
* gcc.target/i386/stackalign/pr88483-1.c: New test.
* gcc.target/i386/stackalign/pr88483-2.c: Likewise.
From-SVN: r271517
Diffstat (limited to 'gcc/json.h')
0 files changed, 0 insertions, 0 deletions