diff options
author | Jan Hubicka <hubicka@gcc.gnu.org> | 2013-09-06 10:36:44 +0000 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2013-09-06 10:36:44 +0000 |
commit | 9e401b63cdc1e9b6c4ea47309e1ebdf5652164b5 (patch) | |
tree | a1ddfe75690ca0907c186d72de5de2d335a7e132 /gcc | |
parent | c1d49770cb83fe768d4dac9cedaa31d59bc0ae28 (diff) | |
download | gcc-9e401b63cdc1e9b6c4ea47309e1ebdf5652164b5.zip gcc-9e401b63cdc1e9b6c4ea47309e1ebdf5652164b5.tar.gz gcc-9e401b63cdc1e9b6c4ea47309e1ebdf5652164b5.tar.bz2 |
Makefile.in (tree-sra.o): Update dependencies.
* Makefile.in (tree-sra.o): Update dependencies.
* tree-sra.c: Include ipa-utils.h
(scan_function): Use recursive_call_p.
(has_caller_p): New function.
(cgraph_for_node_and_aliases): Count also callers of aliases.
From-SVN: r202319
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/Makefile.in | 2 | ||||
-rw-r--r-- | gcc/tree-sra.c | 16 |
2 files changed, 14 insertions, 4 deletions
diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 8430300..a72b753 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -3104,7 +3104,7 @@ tree-sra.o : tree-sra.c $(CONFIG_H) $(SYSTEM_H) coretypes.h alloc-pool.h \ $(HASH_TABLE_H) $(TM_H) $(TREE_H) $(GIMPLE_H) $(CGRAPH_H) $(TREE_FLOW_H) \ $(IPA_PROP_H) $(DIAGNOSTIC_H) statistics.h \ $(PARAMS_H) $(TARGET_H) $(FLAGS_H) \ - $(DBGCNT_H) $(TREE_INLINE_H) $(GIMPLE_PRETTY_PRINT_H) + $(DBGCNT_H) $(TREE_INLINE_H) $(GIMPLE_PRETTY_PRINT_H) ipa-utils.h tree-switch-conversion.o : tree-switch-conversion.c $(CONFIG_H) $(SYSTEM_H) \ $(TREE_H) $(TM_P_H) $(TREE_FLOW_H) $(DIAGNOSTIC_H) $(TREE_INLINE_H) \ $(TM_H) coretypes.h $(GIMPLE_H) $(CFGLOOP_H) \ diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index 8e3bb81..7ed1668 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -91,6 +91,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-inline.h" #include "gimple-pretty-print.h" #include "ipa-inline.h" +#include "ipa-utils.h" /* Enumeration of all aggregate reductions we can do. */ enum sra_mode { SRA_MODE_EARLY_IPA, /* early call regularization */ @@ -1256,8 +1257,7 @@ scan_function (void) if (DECL_BUILT_IN_CLASS (dest) == BUILT_IN_NORMAL && DECL_FUNCTION_CODE (dest) == BUILT_IN_APPLY_ARGS) encountered_apply_args = true; - if (cgraph_get_node (dest) - == cgraph_get_node (current_function_decl)) + if (recursive_call_p (current_function_decl, dest)) { encountered_recursive_call = true; if (!callsite_has_enough_arguments_p (stmt)) @@ -4906,6 +4906,16 @@ modify_function (struct cgraph_node *node, ipa_parm_adjustment_vec adjustments) return cfg_changed; } +/* If NODE has a caller, return true. */ + +static bool +has_caller_p (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED) +{ + if (node->callers) + return true; + return false; +} + /* Return false the function is apparently unsuitable for IPA-SRA based on it's attributes, return true otherwise. NODE is the cgraph node of the current function. */ @@ -4949,7 +4959,7 @@ ipa_sra_preliminary_function_checks (struct cgraph_node *node) return false; } - if (!node->callers) + if (!cgraph_for_node_and_aliases (node, has_caller_p, NULL, true)) { if (dump_file) fprintf (dump_file, |