x86: Properly check saved register CFA offset
authorH.J. Lu <hongjiu.lu@intel.com>
Wed, 26 Jul 2017 19:13:23 +0000 (19:13 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Wed, 26 Jul 2017 19:13:23 +0000 (12:13 -0700)
commita7473dc5b57a7c890f52cf9d90a91d75d3d69a9e
treee0af4bc0092b8bb4f35312a7eba772cf30f8a203
parenta39d4348cdf4a5521710389143b93d9047e23a46
x86: Properly check saved register CFA offset

X86 prologue saves register at CFA offset.  Since its location on stack
is computed as CFA - its CFA_OFFSET, CFA_OFFSET points the end of the
saved register area on stack.  This patch updates sp_valid_at and
fp_valid_at to properly check saved register CFA offset.

gcc/

PR target/81563
* config/i386/i386.c (sp_valid_at): Properly check CFA offset.
(fp_valid_at): Likewise.

gcc/testsuite/

PR target/81563
* gcc.target/i386/pr81563.c: New test

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