https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25967
--- Comment #17 from uros at gcc dot gnu.org --- Author: uros Date: Mon Jul 31 10:22:41 2017 New Revision: 250736 URL: https://gcc.gnu.org/viewcvs?rev=250736&root=gcc&view=rev Log: 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. Added: trunk/gcc/testsuite/gcc.target/i386/naked-1.c trunk/gcc/testsuite/gcc.target/i386/naked-2.c trunk/gcc/testsuite/gcc.target/i386/naked-3.c Modified: trunk/gcc/ChangeLog trunk/gcc/config/i386/i386.c trunk/gcc/doc/extend.texi trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.dg/pr44290-1.c trunk/gcc/testsuite/gcc.dg/pr44290-2.c trunk/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.c