re PR target/25967 (Add attribute naked for x86)
authorUros Bizjak <uros@gcc.gnu.org>
Mon, 31 Jul 2017 10:22:41 +0000 (12:22 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Mon, 31 Jul 2017 10:22:41 +0000 (12:22 +0200)
commit2ec580be156c39a87ea39c2f475565bd36d82dcc
tree3c8c015e05face5b65528fc39a51a140f7eeb648
parentcfdf6ff61b8107d124f41c426d65acf8b5ad8cf5
re PR target/25967 (Add attribute naked for x86)

PR target/25967
* config/i386/i386.c (ix86_function_naked): New function.
(ix86_can_use_return_insn_p): Return false for naked functions.
(ix86_expand_prologue): Skip prologue for naked functions.
(ix86_expand_epilogue): Skip epilogue for naked functions
and emit trap instruction.
(ix86_warn_func_return): New function.
(ix86_attribute_table): Add "naked" attribute specification.
(TARGET_WARN_FUNC_RETURN): Define.
* doc/extend.texi (x86 Function Attributes) <naked>: Document it.

testsuite/ChangeLog:

PR target/25967
* gcc.target/i386/naked-1.c: New test.
* gcc.target/i386/naked-2.c: Ditto.
* gcc.target/i386/naked-3.c: Ditto.
* gcc.target/x86_64/abi/ms-sysv/ms-sysv.c: Remove
do_test_body0 stub function, use attribute "naked" instead.
* gcc.dg/pr44290-1.c: Use naked_functions effective target.
* gcc.dg/pr44290-2.c: Ditto.

From-SVN: r250736
gcc/ChangeLog
gcc/config/i386/i386.c
gcc/doc/extend.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr44290-1.c
gcc/testsuite/gcc.dg/pr44290-2.c
gcc/testsuite/gcc.target/i386/naked-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/naked-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/naked-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.c