diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2022-03-04 05:53:14 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2022-03-08 09:56:02 -0800 |
commit | 23ed4df521db9d66782d3f9cf291fc2564cf313a (patch) | |
tree | 78b75ca4955396d2f68659881aa2597748d47601 /gcc/config | |
parent | 796f5220c808bc37adbd1081476589ab1a5d7ac3 (diff) | |
download | gcc-23ed4df521db9d66782d3f9cf291fc2564cf313a.zip gcc-23ed4df521db9d66782d3f9cf291fc2564cf313a.tar.gz gcc-23ed4df521db9d66782d3f9cf291fc2564cf313a.tar.bz2 |
x86: Disallow unsupported EH return
Disallow stack realignment and regparm nested function with EH return
since they don't work together.
gcc/
PR target/104781
* config/i386/i386.cc (ix86_expand_epilogue): Sorry if there is
stack realignment or regparm nested function with EH return.
gcc/testsuite/
PR target/104781
* gcc.target/i386/eh_return-1.c: Add -mincoming-stack-boundary=4.
* gcc.target/i386/eh_return-2.c: Likewise.
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/i386/i386.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc index efa947f..4121f98 100644 --- a/gcc/config/i386/i386.cc +++ b/gcc/config/i386/i386.cc @@ -9444,12 +9444,15 @@ ix86_expand_epilogue (int style) rtx sa = EH_RETURN_STACKADJ_RTX; rtx_insn *insn; - /* %ecx can't be used for both DRAP register and eh_return. */ - if (crtl->drap_reg) - gcc_assert (REGNO (crtl->drap_reg) != CX_REG); + /* Stack realignment doesn't work with eh_return. */ + if (crtl->stack_realign_needed) + sorry ("Stack realignment not supported with " + "%<__builtin_eh_return%>"); /* regparm nested functions don't work with eh_return. */ - gcc_assert (!ix86_static_chain_on_stack); + if (ix86_static_chain_on_stack) + sorry ("regparm nested function not supported with " + "%<__builtin_eh_return%>"); if (frame_pointer_needed) { |