diff options
Diffstat (limited to 'gcc-4.9/gcc/ipa-cp.c')
-rw-r--r-- | gcc-4.9/gcc/ipa-cp.c | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/gcc-4.9/gcc/ipa-cp.c b/gcc-4.9/gcc/ipa-cp.c index 689378a73..16c629d55 100644 --- a/gcc-4.9/gcc/ipa-cp.c +++ b/gcc-4.9/gcc/ipa-cp.c @@ -115,8 +115,10 @@ along with GCC; see the file COPYING3. If not see #include "tree-pretty-print.h" #include "tree-inline.h" #include "params.h" +#include "dbgcnt.h" #include "ipa-inline.h" #include "ipa-utils.h" +#include "l-ipo.h" struct ipcp_value; @@ -433,6 +435,8 @@ determine_versionability (struct cgraph_node *node) else if (!opt_for_fn (node->decl, optimize) || !opt_for_fn (node->decl, flag_ipa_cp)) reason = "non-optimized function"; + else if (node->tm_clone) + reason = "transactional memory clone"; else if (lookup_attribute ("omp declare simd", DECL_ATTRIBUTES (node->decl))) { /* Ideally we should clone the SIMD clones themselves and create @@ -1531,6 +1535,8 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie, TREE_CODE (t) == ADDR_EXPR && TREE_CODE (TREE_OPERAND (t, 0)) == FUNCTION_DECL) return TREE_OPERAND (t, 0); + else if (L_IPO_COMP_MODE && t && TREE_CODE (t) == FUNCTION_DECL) + return t; else return NULL_TREE; } @@ -1587,15 +1593,7 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie, && DECL_FUNCTION_CODE (target) == BUILT_IN_UNREACHABLE) || !possible_polymorphic_call_target_p (ie, cgraph_get_node (target))) - { - if (dump_file) - fprintf (dump_file, - "Type inconsident devirtualization: %s/%i->%s\n", - ie->caller->name (), ie->caller->order, - IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (target))); - target = builtin_decl_implicit (BUILT_IN_UNREACHABLE); - cgraph_get_create_node (target); - } + target = ipa_impossible_devirt_target (ie, target); return target; } } @@ -1629,7 +1627,7 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie, if (targets.length () == 1) target = targets[0]->decl; else - target = builtin_decl_implicit (BUILT_IN_UNREACHABLE); + target = ipa_impossible_devirt_target (ie, NULL_TREE); } else { @@ -1643,15 +1641,7 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie, if (target && !possible_polymorphic_call_target_p (ie, cgraph_get_node (target))) - { - if (dump_file) - fprintf (dump_file, - "Type inconsident devirtualization: %s/%i->%s\n", - ie->caller->name (), ie->caller->order, - IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (target))); - target = builtin_decl_implicit (BUILT_IN_UNREACHABLE); - cgraph_get_create_node (target); - } + target = ipa_impossible_devirt_target (ie, target); return target; } @@ -2482,7 +2472,8 @@ cgraph_edge_brings_value_p (struct cgraph_edge *cs, struct ipcp_value_source *src) { struct ipa_node_params *caller_info = IPA_NODE_REF (cs->caller); - struct ipa_node_params *dst_info = IPA_NODE_REF (cs->callee); + cgraph_node *real_dest = cgraph_function_node (cs->callee); + struct ipa_node_params *dst_info = IPA_NODE_REF (real_dest); if ((dst_info->ipcp_orig_node && !dst_info->is_all_contexts_clone) || caller_info->node_dead) |