x86: Don't use get_frame_size when finalizing stack frame
authorH.J. Lu <hongjiu.lu@intel.com>
Fri, 14 Dec 2018 12:38:04 +0000 (12:38 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Fri, 14 Dec 2018 12:38:04 +0000 (04:38 -0800)
commit4f472e636f7e99c3bca2fb70bd5adc2bb07dad3d
tree9cc66ec9c0f5de6f878eed0d32c22b2a5329a741
parentf961ec70ee07768f87e9e2ce2b3cac4160fd065e
x86: Don't use get_frame_size when finalizing stack frame

get_frame_size () returns used stack slots during compilation, which
may be optimized out later.  Since ix86_find_max_used_stack_alignment
is called by ix86_finalize_stack_frame_flags to check if stack frame
is required, there is no need to call get_frame_size () which may give
inaccurate final stack frame size.

Tested on AVX512 machine configured with

--with-arch=native --with-cpu=native

gcc/

PR target/88483
* config/i386/i386.c (ix86_finalize_stack_frame_flags): Don't
use get_frame_size ().

gcc/testsuite/

PR target/88483
* gcc.target/i386/stackalign/pr88483.c: New test.

From-SVN: r267133
gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/stackalign/pr88483.c [new file with mode: 0644]