diff options
author | Jan Hubicka <hubicka@gcc.gnu.org> | 2011-01-26 14:06:20 +0000 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2011-01-26 14:06:20 +0000 |
commit | 61e03ffc6b8284abe34837fc85a82566ee4552ee (patch) | |
tree | 4e831ce4ac2924d53233e6215470e4dbd88eea9a /gcc/ipa-inline.c | |
parent | 980ca89173da230e449a8e8017f0b2c2b46a374a (diff) | |
download | gcc-61e03ffc6b8284abe34837fc85a82566ee4552ee.zip gcc-61e03ffc6b8284abe34837fc85a82566ee4552ee.tar.gz gcc-61e03ffc6b8284abe34837fc85a82566ee4552ee.tar.bz2 |
re PR tree-optimization/47237 (builtin_apply_args broken WRT local ABI changes.)
PR target/47237
* cgraph.h (cgraph_local_info): New field can_change_signature.
* ipa-cp.c (ipcp_update_callgraph): Only compute args_to_skip if callee
signature can change.
(ipcp_estimate_growth): Call sequence simplify only if calle signature
can change.
(ipcp_insert_stage): Only compute args_to_skip if signature can change.
(cgraph_function_versioning): We can not change signature of functions
that don't allow that.
* lto-cgraph.c (lto_output_node): Stream local.can_change_signature.
(lto_input_node): Likewise.
* ipa-inline.c (compute_inline_parameters): Compute local.can_change_signature.
* ipa-split.c (visit_bb): Never split away APPLY_ARGS.
* tree-sra.c (ipa_sra_preliminary_function_checks): Give up on functions
that can not change signature.
* i386.c (ix86_function_regparm, ix86_function_sseregparm,
init_cumulative_args): Do not use local calling conventions for functions
that can not change signature.
From-SVN: r169290
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r-- | gcc/ipa-inline.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 116abd6..8087c81 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -1997,6 +1997,22 @@ compute_inline_parameters (struct cgraph_node *node) /* Can this function be inlined at all? */ node->local.inlinable = tree_inlinable_function_p (node->decl); + + /* Inlinable functions always can change signature. */ + if (node->local.inlinable) + node->local.can_change_signature = true; + else + { + struct cgraph_edge *e; + + /* Functions calling builtlin_apply can not change signature. */ + for (e = node->callees; e; e = e->next_callee) + if (DECL_BUILT_IN (e->callee->decl) + && DECL_BUILT_IN_CLASS (e->callee->decl) == BUILT_IN_NORMAL + && DECL_FUNCTION_CODE (e->callee->decl) == BUILT_IN_APPLY_ARGS) + break; + node->local.can_change_signature = !e; + } if (node->local.inlinable && !node->local.disregard_inline_limits) node->local.disregard_inline_limits = DECL_DISREGARD_INLINE_LIMITS (node->decl); |