i386: Don't generate alias for function return thunk
authorH.J. Lu <hongjiu.lu@intel.com>
Thu, 15 Mar 2018 17:54:40 +0000 (17:54 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Thu, 15 Mar 2018 17:54:40 +0000 (10:54 -0700)
commit23f95cb77ab469d83f9fcc35417a6c66f823cf92
treea8229da1eb51aaa17f500762fbad39c6fb9611ac
parent4a5a49b034eed5373f6968c99bda1827f1479580
i386: Don't generate alias for function return thunk

Function return thunks shouldn't be aliased to indirect branch thunks
since indirect branch thunks are placed in COMDAT section and a COMDAT
section with indirect branch may not have function return thunk.  This
patch generates function return thunks directly.

gcc/

PR target/84574
* config/i386/i386.c (indirect_thunk_needed): Update comments.
(indirect_thunk_bnd_needed): Likewise.
(indirect_thunks_used): Likewise.
(indirect_thunks_bnd_used): Likewise.
(indirect_return_needed): New.
(indirect_return_bnd_needed): Likewise.
(output_indirect_thunk_function): Add a bool argument for
function return.
(output_indirect_thunk_function): Don't generate alias for
function return thunk.
(ix86_code_end): Call output_indirect_thunk_function to generate
function return thunks.
(ix86_output_function_return): Set indirect_return_bnd_needed
and indirect_return_needed instead of indirect_thunk_bnd_needed
and indirect_thunk_needed.

gcc/testsuite/

PR target/84574
* gcc.target/i386/ret-thunk-9.c: Expect __x86_return_thunk
label instead of __x86_indirect_thunk label.

From-SVN: r258569
gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/ret-thunk-9.c