re PR middle-end/23221 (-fstack-protector does not protect tail call functions)
authorRichard Henderson <rth@redhat.com>
Thu, 4 Aug 2005 03:57:41 +0000 (20:57 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 4 Aug 2005 03:57:41 +0000 (20:57 -0700)
        PR 23221
        * function.c (stack_protect_epilogue): Export.
        * tree.h (stack_protect_epilogue): Declare.
        * calls.c (expand_call): Call it.

From-SVN: r102731

gcc/ChangeLog
gcc/calls.c
gcc/function.c
gcc/tree.h

index afeda5c2c6dd9636dca36df0fa1331236b61f0f0..2a7ffc77f518230e2e712cb86428b148e6e62179 100644 (file)
@@ -1,3 +1,10 @@
+2005-08-03  Richard Henderson  <rth@redhat.com>
+
+       PR 23221
+       * function.c (stack_protect_epilogue): Export.
+       * tree.h (stack_protect_epilogue): Declare.
+       * calls.c (expand_call): Call it.
+
 2005-08-03  Eric Christopher  <echristo@apple.com>
 
        * gcc.c (LINK_SSP_SPEC): Add fstack-protector-all.
index d51fbf6331bfe8a9ce64d9ca66e2cc7eb1bfd6b1..84e0db78c7f1fe25c620ec0e6a61847b3667b801 100644 (file)
@@ -2247,6 +2247,9 @@ expand_call (tree exp, rtx target, int ignore)
       if (pass && (flags & (ECF_LIBCALL_BLOCK | ECF_MALLOC)))
        start_sequence ();
 
+      if (pass == 0 && cfun->stack_protect_guard)
+       stack_protect_epilogue ();
+
       adjusted_args_size = args_size;
       /* Compute the actual size of the argument block required.  The variable
         and constant sizes must be combined, the size may have to be rounded,
index 2b4fe1bfc6c9ed02b469487478129e8941bd2c1d..225c2a981179750c4cf4a9878dbbd3ccb6530209 100644 (file)
@@ -4013,7 +4013,7 @@ stack_protect_prologue (void)
 # define gen_stack_protect_test(x, y, z)       (gcc_unreachable (), NULL_RTX)
 #endif
 
-static void
+void
 stack_protect_epilogue (void)
 {
   tree guard_decl = targetm.stack_protect_guard ();
index cae0c8b12d62afe0a7cdde08a35561ec3bfcf085..b6b637af9d5a2d9020a64e2debaa676af5d82283 100644 (file)
@@ -3908,6 +3908,7 @@ extern void dump_tree_statistics (void);
 extern void expand_function_end (void);
 extern void expand_function_start (tree);
 extern void stack_protect_prologue (void);
+extern void stack_protect_epilogue (void);
 extern void recompute_tree_invarant_for_addr_expr (tree);
 extern bool is_global_var (tree t);
 extern bool needs_to_live_in_memory (tree);