diff options
author | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-03-30 12:38:36 +0000 |
---|---|---|
committer | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-03-30 12:38:36 +0000 |
commit | aac1a233900c7b825e07ae7b49249459eb3bde9f (patch) | |
tree | 5d8238b92b23513b70abcdb0a8fbab5089543d85 | |
parent | 883c45b3c18ce243ab6bc0984805a23165081b36 (diff) |
Properly check conflict between DRAP register and __builtin_eh_return
Since %ecx can't be used for both DRAP register and __builtin_eh_return,
we need to check if crtl->drap_reg uses %ecx before using %ecx for
__builtin_eh_return.
PR target/70439
* config/i386/i386.c (ix86_expand_epilogue): Properly check
conflict between DRAP register and __builtin_eh_return.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@234559 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/config/i386/i386.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 1639704835b..f700a25e1c0 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -13463,9 +13463,11 @@ ix86_expand_epilogue (int style) rtx sa = EH_RETURN_STACKADJ_RTX; rtx_insn *insn; - /* Stack align doesn't work with eh_return. */ - gcc_assert (!stack_realign_drap); - /* Neither does regparm nested functions. */ + /* %ecx can't be used for both DRAP register and eh_return. */ + if (crtl->drap_reg) + gcc_assert (REGNO (crtl->drap_reg) != CX_REG); + + /* regparm nested functions don't work with eh_return. */ gcc_assert (!ix86_static_chain_on_stack); if (frame_pointer_needed) |