From: H.J. Lu Date: Wed, 30 Mar 2016 12:38:36 +0000 (-0700) Subject: Properly check conflict between DRAP register and __builtin_eh_return X-Git-Tag: upstream/12.2.0~48091 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=41ec61d3ef99e27e1d2584836ce8c6483c628689;p=platform%2Fupstream%2Fgcc.git 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. From-SVN: r234559 --- diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 1639704..f700a25 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)