[Bug target/81563] [8 Regression] Callee-saved registers are restored incorrectly

hjl at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jul 26 19:14:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81563

--- Comment #2 from hjl at gcc dot gnu.org <hjl at gcc dot gnu.org> ---
Author: hjl
Date: Wed Jul 26 19:13:23 2017
New Revision: 250587

URL: https://gcc.gnu.org/viewcvs?rev=250587&root=gcc&view=rev
Log:
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

Added:
    trunk/gcc/testsuite/gcc.target/i386/pr81563.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386.c
    trunk/gcc/testsuite/ChangeLog


More information about the Gcc-bugs mailing list