mirror of git://gcc.gnu.org/git/gcc.git
parent
a03a9774c1
commit
2e1ec94ff0
|
|
@ -1,3 +1,12 @@
|
||||||
|
2010-07-08 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
|
||||||
|
|
||||||
|
PR bootstrap/44768
|
||||||
|
* cfgexpand.c (estimated_stack_frame_size): Make self-contained
|
||||||
|
with respect to current_function_decl. Pass decl of the function.
|
||||||
|
* tree-inline.h (estimated_stack_frame_size): Adjust prototype.
|
||||||
|
* ipa-inline.c (compute_inline_parameters): Pass decl to
|
||||||
|
estimated_stack_frame_size.
|
||||||
|
|
||||||
2010-07-08 Richard Guenther <rguenther@suse.de>
|
2010-07-08 Richard Guenther <rguenther@suse.de>
|
||||||
|
|
||||||
* tree-ssa-sccvn.c (vn_reference_maybe_forwprop_address):
|
* tree-ssa-sccvn.c (vn_reference_maybe_forwprop_address):
|
||||||
|
|
|
||||||
|
|
@ -1252,8 +1252,8 @@ fini_vars_expansion (void)
|
||||||
stack_vars_alloc = stack_vars_num = 0;
|
stack_vars_alloc = stack_vars_num = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make a fair guess for the size of the stack frame of the current
|
/* Make a fair guess for the size of the stack frame of the decl
|
||||||
function. This doesn't have to be exact, the result is only used
|
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
|
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
|
var packing algorithm (which is quadratic in the number of stack
|
||||||
vars). Instead, we calculate the total size of all stack vars.
|
vars). Instead, we calculate the total size of all stack vars.
|
||||||
|
|
@ -1261,12 +1261,15 @@ fini_vars_expansion (void)
|
||||||
vars doesn't happen very often. */
|
vars doesn't happen very often. */
|
||||||
|
|
||||||
HOST_WIDE_INT
|
HOST_WIDE_INT
|
||||||
estimated_stack_frame_size (void)
|
estimated_stack_frame_size (tree decl)
|
||||||
{
|
{
|
||||||
HOST_WIDE_INT size = 0;
|
HOST_WIDE_INT size = 0;
|
||||||
size_t i;
|
size_t i;
|
||||||
tree var, outer_block = DECL_INITIAL (current_function_decl);
|
tree var, outer_block = DECL_INITIAL (current_function_decl);
|
||||||
unsigned ix;
|
unsigned ix;
|
||||||
|
tree old_cur_fun_decl = current_function_decl;
|
||||||
|
current_function_decl = decl;
|
||||||
|
push_cfun (DECL_STRUCT_FUNCTION (decl));
|
||||||
|
|
||||||
init_vars_expansion ();
|
init_vars_expansion ();
|
||||||
|
|
||||||
|
|
@ -1287,7 +1290,8 @@ estimated_stack_frame_size (void)
|
||||||
size += account_stack_vars ();
|
size += account_stack_vars ();
|
||||||
fini_vars_expansion ();
|
fini_vars_expansion ();
|
||||||
}
|
}
|
||||||
|
pop_cfun ();
|
||||||
|
current_function_decl = old_cur_fun_decl;
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2019,7 +2019,7 @@ compute_inline_parameters (struct cgraph_node *node)
|
||||||
|
|
||||||
/* Estimate the stack size for the function. But not at -O0
|
/* Estimate the stack size for the function. But not at -O0
|
||||||
because estimated_stack_frame_size is a quadratic problem. */
|
because estimated_stack_frame_size is a quadratic problem. */
|
||||||
self_stack_size = optimize ? estimated_stack_frame_size () : 0;
|
self_stack_size = optimize ? estimated_stack_frame_size (node->decl) : 0;
|
||||||
inline_summary (node)->estimated_self_stack_size = self_stack_size;
|
inline_summary (node)->estimated_self_stack_size = self_stack_size;
|
||||||
node->global.estimated_stack_size = self_stack_size;
|
node->global.estimated_stack_size = self_stack_size;
|
||||||
node->global.stack_frame_offset = 0;
|
node->global.stack_frame_offset = 0;
|
||||||
|
|
|
||||||
|
|
@ -185,6 +185,6 @@ extern tree remap_decl (tree decl, copy_body_data *id);
|
||||||
extern tree remap_type (tree type, copy_body_data *id);
|
extern tree remap_type (tree type, copy_body_data *id);
|
||||||
extern gimple_seq copy_gimple_seq_and_replace_locals (gimple_seq seq);
|
extern gimple_seq copy_gimple_seq_and_replace_locals (gimple_seq seq);
|
||||||
|
|
||||||
extern HOST_WIDE_INT estimated_stack_frame_size (void);
|
extern HOST_WIDE_INT estimated_stack_frame_size (tree);
|
||||||
|
|
||||||
#endif /* GCC_TREE_INLINE_H */
|
#endif /* GCC_TREE_INLINE_H */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue