diff options
author | Richard Henderson <rth@redhat.com> | 2005-08-03 20:57:41 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2005-08-03 20:57:41 -0700 |
commit | b755446cef42521b9cbfbf4a3fe334db4d9054f2 (patch) | |
tree | 389fa11256e277631e1679c27218e3f2f99cb718 /gcc | |
parent | a4f5cd4441e5e5a140ad6495eef56b88462ca807 (diff) | |
download | gcc-b755446cef42521b9cbfbf4a3fe334db4d9054f2.zip gcc-b755446cef42521b9cbfbf4a3fe334db4d9054f2.tar.gz gcc-b755446cef42521b9cbfbf4a3fe334db4d9054f2.tar.bz2 |
re PR middle-end/23221 (-fstack-protector does not protect tail call functions)
PR 23221
* function.c (stack_protect_epilogue): Export.
* tree.h (stack_protect_epilogue): Declare.
* calls.c (expand_call): Call it.
From-SVN: r102731
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/calls.c | 3 | ||||
-rw-r--r-- | gcc/function.c | 2 | ||||
-rw-r--r-- | gcc/tree.h | 1 |
4 files changed, 12 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index afeda5c..2a7ffc7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/calls.c b/gcc/calls.c index d51fbf6..84e0db7 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -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, diff --git a/gcc/function.c b/gcc/function.c index 2b4fe1b..225c2a9 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -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 (); @@ -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); |