aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2011-02-15 18:36:44 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2011-02-15 18:36:44 +0000
commit30925d946aa6b2bf93cc9f090ca517f3622df1ff (patch)
tree9313ad3b545e7a4daed208b127cfbe5ded452723 /gcc/cfgexpand.c
parent1b9a784a8988c08979949b85fcf9746574a72ae0 (diff)
downloadgcc-30925d946aa6b2bf93cc9f090ca517f3622df1ff.zip
gcc-30925d946aa6b2bf93cc9f090ca517f3622df1ff.tar.gz
gcc-30925d946aa6b2bf93cc9f090ca517f3622df1ff.tar.bz2
re PR debug/47106 (-fcompare-debug failure (length) with -fpartial-inlining -flto -fconserve-stack)
PR debug/47106 PR debug/47402 * tree-inline.h (estimated_stack_frame_size): Take cgraph node rather than decl. * cfgexpand.c (estimated_stack_frame_size): Likewise. * ipa-inline.c (compute_inline_parameters): Adjust. From-SVN: r170187
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 6fdb10d..4772fea 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -1366,24 +1366,25 @@ fini_vars_expansion (void)
stack_vars_alloc = stack_vars_num = 0;
}
-/* Make a fair guess for the size of the stack frame of the decl
- passed. This doesn't have to be exact, the result is only used
- in the inline heuristics. So we don't want to run the full stack
- var packing algorithm (which is quadratic in the number of stack
- vars). Instead, we calculate the total size of all stack vars.
- This turns out to be a pretty fair estimate -- packing of stack
- vars doesn't happen very often. */
+/* Make a fair guess for the size of the stack frame of the function
+ in NODE. This doesn't have to be exact, the result is only used in
+ the inline heuristics. So we don't want to run the full stack var
+ packing algorithm (which is quadratic in the number of stack vars).
+ Instead, we calculate the total size of all stack vars. This turns
+ out to be a pretty fair estimate -- packing of stack vars doesn't
+ happen very often. */
HOST_WIDE_INT
-estimated_stack_frame_size (tree decl)
+estimated_stack_frame_size (struct cgraph_node *node)
{
HOST_WIDE_INT size = 0;
size_t i;
tree var, outer_block = DECL_INITIAL (current_function_decl);
unsigned ix;
tree old_cur_fun_decl = current_function_decl;
- current_function_decl = decl;
- push_cfun (DECL_STRUCT_FUNCTION (decl));
+
+ current_function_decl = node->decl;
+ push_cfun (DECL_STRUCT_FUNCTION (node->decl));
init_vars_expansion ();