From 17b29c0a1700733775c8190c57117fe3bbbd91cf Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sat, 10 May 2008 00:41:39 +0000 Subject: [PATCH] calls.c (expand_call): Don't use callgraph to increase preferred_stack_boundary. 2008-05-09 H.J. Lu * calls.c (expand_call): Don't use callgraph to increase preferred_stack_boundary. * cgraph.h (cgraph_rtl_info): Use unsigned on preferred_incoming_stack_boundary. * final.c (rest_of_clean_state): Use unsigned on preferred_stack_boundary. From-SVN: r135134 --- gcc/ChangeLog | 11 +++++++++++ gcc/calls.c | 9 ++++++++- gcc/cgraph.h | 2 +- gcc/final.c | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3d1e78add32..d9cb32655ee 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2008-05-09 H.J. Lu + + * calls.c (expand_call): Don't use callgraph to increase + preferred_stack_boundary. + + * cgraph.h (cgraph_rtl_info): Use unsigned on + preferred_incoming_stack_boundary. + + * final.c (rest_of_clean_state): Use unsigned on + preferred_stack_boundary. + 2008-05-09 Tom Tromey PR preprocessor/22231: diff --git a/gcc/calls.c b/gcc/calls.c index bbb9b769c49..ac839827125 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -2109,7 +2109,14 @@ expand_call (tree exp, rtx target, int ignore) if (fndecl) { struct cgraph_rtl_info *i = cgraph_rtl_info (fndecl); - if (i && i->preferred_incoming_stack_boundary) + /* Without automatic stack alignment, we can't increase preferred + stack boundary. With automatic stack alignment, it is + unnecessary since unless we can guarantee that all callers will + align the outgoing stack properly, callee has to align its + stack anyway. */ + if (i + && i->preferred_incoming_stack_boundary + && i->preferred_incoming_stack_boundary < preferred_stack_boundary) preferred_stack_boundary = i->preferred_incoming_stack_boundary; } diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 3b65dc82914..97b5e1fd484 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -118,7 +118,7 @@ struct cgraph_global_info GTY(()) struct cgraph_rtl_info GTY(()) { - int preferred_incoming_stack_boundary; + unsigned int preferred_incoming_stack_boundary; }; /* The cgraph data structure. diff --git a/gcc/final.c b/gcc/final.c index ccef70f00f1..b3185811ad6 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -4239,7 +4239,7 @@ rest_of_clean_state (void) if (targetm.binds_local_p (current_function_decl)) { - int pref = crtl->preferred_stack_boundary; + unsigned int pref = crtl->preferred_stack_boundary; if (crtl->stack_alignment_needed > crtl->preferred_stack_boundary) pref = crtl->stack_alignment_needed; cgraph_rtl_info (current_function_decl)->preferred_incoming_stack_boundary -- 2.30.2