This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/25967] Add attribute naked for x86
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 30 Jul 2017 16:08:15 +0000
- Subject: [Bug target/25967] Add attribute naked for x86
- Auto-submitted: auto-generated
- References: <bug-25967-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25967
--- Comment #14 from Uroš Bizjak <ubizjak at gmail dot com> ---
I'm testing the above patch. Using the patched compiler, the testcase that is
mentioned by Daniel in Comment #12 can be changed to:
Index: testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.c
===================================================================
--- testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.c (revision 250720)
+++ testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.c (working copy)
@@ -169,15 +169,9 @@
#define TEST_DATA_OFFSET(f) ((int)__builtin_offsetof(struct test_data, f))
-void __attribute__((used))
-do_test_body0 (void)
-{
- __asm__ ("\n"
- " .globl " ASMNAME(do_test_body) "\n"
-#ifdef __ELF__
- " .type " ASMNAME(do_test_body) ",@function\n"
-#endif
- ASMNAME(do_test_body) ":\n"
+void __attribute__((naked))
+do_test_body (void)
+{__asm__ (
" # rax, r10 and r11 are usable here.\n"
"\n"
" # Save registers.\n"
@@ -212,9 +206,6 @@
" call " ASMNAME(mem_to_regs) "\n"
"\n"
" retq\n"
-#ifdef __ELF__
- " .size " ASMNAME(do_test_body) ",.-" ASMNAME(do_test_body) "\n"
-#endif
::
"i"(TEST_DATA_OFFSET(regdata[REG_SET_SAVE])),
"i"(TEST_DATA_OFFSET(regdata[REG_SET_INPUT])),