return default_stack_protect_guard ();
}
+static bool
+ix86_stack_protect_runtime_enabled_p (void)
+{
+ /* Naked functions should not enable stack protector. */
+ return !ix86_function_naked (current_function_decl);
+}
+
/* For 32-bit code we can save PIC register setup by using
__stack_chk_fail_local hidden function instead of calling
__stack_chk_fail directly. 64-bit code doesn't need to setup any PIC
#undef TARGET_STACK_PROTECT_GUARD
#define TARGET_STACK_PROTECT_GUARD ix86_stack_protect_guard
+#undef TARGET_STACK_PROTECT_RUNTIME_ENABLED_P
+#define TARGET_STACK_PROTECT_RUNTIME_ENABLED_P \
+ ix86_stack_protect_runtime_enabled_p
+
#if !TARGET_MACHO
#undef TARGET_STACK_PROTECT_FAIL
#define TARGET_STACK_PROTECT_FAIL ix86_stack_protect_fail
--- /dev/null
+/* { dg-do compile { target fstack_protector } } */
+/* { dg-options "-O2 -fstack-protector-all" } */
+/* { dg-final { scan-assembler-not "__stack_chk_fail" } } */
+
+__attribute__ ((naked))
+void
+foo (void)
+{
+ asm ("ret");
+}