diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2015-03-04 06:00:49 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2015-03-04 05:00:49 +0000 |
commit | 670654ef11ee2e0c2be59e4a28acc3117de7a003 (patch) | |
tree | b62270518f087b2cdb66952130fefa7baf61200b /gcc | |
parent | e7dbcbc38bc818425329d1ea4ed33c7e98e4eb6b (diff) | |
download | gcc-670654ef11ee2e0c2be59e4a28acc3117de7a003.zip gcc-670654ef11ee2e0c2be59e4a28acc3117de7a003.tar.gz gcc-670654ef11ee2e0c2be59e4a28acc3117de7a003.tar.bz2 |
tree-sra.c (convert_callers): Use call_for_symbol_and_aliases.
* tree-sra.c (convert_callers): Use call_for_symbol_and_aliases.
(struct ipa_sra_check_caller_data): Add has_thunk field.
(ipa_sra_check_caller): Check for thunk.
(ipa_sra_preliminary_function_checks): Give up on function with
thunks.
(ipa_early_sra): Use call_for_symbol_and_aliases.
From-SVN: r221171
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/tree-sra.c | 24 |
2 files changed, 28 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2108eb0..c8c26b4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2015-03-03 Jan Hubicka <hubicka@ucw.cz> + + * tree-sra.c (convert_callers): Use call_for_symbol_and_aliases. + (struct ipa_sra_check_caller_data): Add has_thunk field. + (ipa_sra_check_caller): Check for thunk. + (ipa_sra_preliminary_function_checks): Give up on function with + thunks. + (ipa_early_sra): Use call_for_symbol_and_aliases. + 2015-03-03 Kaz Kojima <kkojima@gcc.gnu.org> PR target/65249 diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index 0aed4d2..3527a47 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -4947,8 +4947,8 @@ convert_callers (struct cgraph_node *node, tree old_decl, { basic_block this_block; - node->call_for_symbol_thunks_and_aliases (convert_callers_for_node, - &adjustments, false); + node->call_for_symbol_and_aliases (convert_callers_for_node, + &adjustments, false); if (!encountered_recursive_call) return; @@ -5016,6 +5016,7 @@ struct ipa_sra_check_caller_data { bool has_callers; bool bad_arg_alignment; + bool has_thunk; }; /* If NODE has a caller, mark that fact in DATA which is pointer to @@ -5035,6 +5036,11 @@ ipa_sra_check_caller (struct cgraph_node *node, void *data) for (cgraph_edge *cs = node->callers; cs; cs = cs->next_caller) { + if (cs->caller->thunk.thunk_p) + { + iscc->has_thunk = true; + return true; + } gimple call_stmt = cs->call_stmt; unsigned count = gimple_call_num_args (call_stmt); for (unsigned i = 0; i < count; i++) @@ -5131,7 +5137,7 @@ ipa_sra_preliminary_function_checks (struct cgraph_node *node) struct ipa_sra_check_caller_data iscc; memset (&iscc, 0, sizeof(iscc)); - node->call_for_symbol_thunks_and_aliases (ipa_sra_check_caller, &iscc, true); + node->call_for_symbol_and_aliases (ipa_sra_check_caller, &iscc, true); if (!iscc.has_callers) { if (dump_file) @@ -5148,6 +5154,14 @@ ipa_sra_preliminary_function_checks (struct cgraph_node *node) return false; } + if (iscc.has_thunk) + { + if (dump_file) + fprintf (dump_file, + "A has thunk.\n"); + return false; + } + return true; } @@ -5173,7 +5187,7 @@ ipa_early_sra (void) goto simple_out; } - if (node->call_for_symbol_thunks_and_aliases + if (node->call_for_symbol_and_aliases (some_callers_have_mismatched_arguments_p, NULL, true)) { if (dump_file) @@ -5182,7 +5196,7 @@ ipa_early_sra (void) goto simple_out; } - if (node->call_for_symbol_thunks_and_aliases + if (node->call_for_symbol_and_aliases (some_callers_have_no_vuse_p, NULL, true)) { if (dump_file) |