diff options
author | Jan Hubicka <jh@suse.cz> | 2010-05-17 09:01:26 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2010-05-17 07:01:26 +0000 |
commit | 199f1dc47fdec0ab1b5c6bd6032ac44f1cd33c8a (patch) | |
tree | bbc8e3011ba87b0637d6a89c5c20c89c7ebc1832 /gcc | |
parent | c4b4455fa9883deaac990e243e68ccf65f5c0bc5 (diff) | |
download | gcc-199f1dc47fdec0ab1b5c6bd6032ac44f1cd33c8a.zip gcc-199f1dc47fdec0ab1b5c6bd6032ac44f1cd33c8a.tar.gz gcc-199f1dc47fdec0ab1b5c6bd6032ac44f1cd33c8a.tar.bz2 |
ipa-cp.c (ipcp_versionable_function_p): Walk cgraph edges instead of function body...
* ipa-cp.c (ipcp_versionable_function_p): Walk cgraph edges instead of
function body; do not check stdarg field of struct function.
From-SVN: r159472
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ipa-cp.c | 32 |
2 files changed, 14 insertions, 23 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cfb3a7f..e5d0942 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2010-05-16 Jan Hubicka <jh@suse.cz> + * ipa-cp.c (ipcp_versionable_function_p): Walk cgraph edges instead of + function body; do not check stdarg field of struct function. + +2010-05-16 Jan Hubicka <jh@suse.cz> + * cgraph.c (dump_cgraph_node): Dump versionable flag. * cgraph.h (cgraph_local_info): Add versionable flag. * ipa-cp.c (ipcp_analyze_node): Set versionable flag. diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index 88a5b4f..723de16 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -416,35 +416,21 @@ ipcp_print_all_lattices (FILE * f) static bool ipcp_versionable_function_p (struct cgraph_node *node) { - tree decl = node->decl; - basic_block bb; + struct cgraph_edge *edge; /* There are a number of generic reasons functions cannot be versioned. */ if (!node->local.versionable) return false; - /* Removing arguments doesn't work if the function takes varargs. */ - if (DECL_STRUCT_FUNCTION (decl)->stdarg) - return false; - - /* Removing arguments doesn't work if we use __builtin_apply_args. */ - FOR_EACH_BB_FN (bb, DECL_STRUCT_FUNCTION (decl)) + /* Removing arguments doesn't work if the function takes varargs + or use __builtin_apply_args. */ + for (edge = node->callees; edge; edge = edge->next_callee) { - gimple_stmt_iterator gsi; - for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) - { - const_gimple stmt = gsi_stmt (gsi); - tree t; - - if (!is_gimple_call (stmt)) - continue; - t = gimple_call_fndecl (stmt); - if (t == NULL_TREE) - continue; - if (DECL_BUILT_IN_CLASS (t) == BUILT_IN_NORMAL - && DECL_FUNCTION_CODE (t) == BUILT_IN_APPLY_ARGS) - return false; - } + tree t = edge->callee->decl; + if (DECL_BUILT_IN_CLASS (t) == BUILT_IN_NORMAL + && (DECL_FUNCTION_CODE (t) == BUILT_IN_APPLY_ARGS + || DECL_FUNCTION_CODE (t) == BUILT_IN_VA_START)) + return false; } return true; |