diff options
author | Martin Jambor <mjambor@suse.cz> | 2011-08-31 19:17:19 +0200 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2011-08-31 19:17:19 +0200 |
commit | 201176d3483714110201548a37b157a33415a635 (patch) | |
tree | a322acd3f7b7a719b28233053d2eace8859ab328 /gcc/ipa-inline-analysis.c | |
parent | 51093fca4c6add337ed31fe13b96d9712ab16743 (diff) | |
download | gcc-201176d3483714110201548a37b157a33415a635.zip gcc-201176d3483714110201548a37b157a33415a635.tar.gz gcc-201176d3483714110201548a37b157a33415a635.tar.bz2 |
re PR middle-end/49886 (pass_split_functions cannot deal with function type attributes)
2011-08-31 Martin Jambor <mjambor@suse.cz>
PR middle-end/49886
* ipa-inline-analysis.c (compute_inline_parameters): Set
can_change_signature of noes with typde attributes.
* ipa-split.c (split_function): Do not skip any arguments if
can_change_signature is set.
* testsuite/gcc.c-torture/execute/pr49886.c: New testcase.
From-SVN: r178386
Diffstat (limited to 'gcc/ipa-inline-analysis.c')
-rw-r--r-- | gcc/ipa-inline-analysis.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c index c0eacbb..b56c669 100644 --- a/gcc/ipa-inline-analysis.c +++ b/gcc/ipa-inline-analysis.c @@ -1660,18 +1660,28 @@ compute_inline_parameters (struct cgraph_node *node, bool early) /* Can this function be inlined at all? */ info->inlinable = tree_inlinable_function_p (node->decl); - /* Inlinable functions always can change signature. */ - if (info->inlinable) - node->local.can_change_signature = true; + /* Type attributes can use parameter indices to describe them. */ + if (TYPE_ATTRIBUTES (TREE_TYPE (node->decl))) + node->local.can_change_signature = false; else { - /* Functions calling builtin_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; + /* Otherwise, inlinable functions always can change signature. */ + if (info->inlinable) + node->local.can_change_signature = true; + else + { + /* Functions calling builtin_apply can not change signature. */ + for (e = node->callees; e; e = e->next_callee) + { + tree cdecl = e->callee->decl; + if (DECL_BUILT_IN (cdecl) + && DECL_BUILT_IN_CLASS (cdecl) == BUILT_IN_NORMAL + && (DECL_FUNCTION_CODE (cdecl) == BUILT_IN_APPLY_ARGS + || DECL_FUNCTION_CODE (cdecl) == BUILT_IN_VA_START)) + break; + } + node->local.can_change_signature = !e; + } } estimate_function_body_sizes (node, early); |