diff options
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r-- | gcc/ipa-prop.c | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index 4f887a0..d225b85 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -295,31 +295,6 @@ ipa_print_all_jump_functions (FILE *f) } } -/* Worker for prune_expression_for_jf. */ - -static tree -prune_expression_for_jf_1 (tree *tp, int *walk_subtrees, void *) -{ - if (EXPR_P (*tp)) - SET_EXPR_LOCATION (*tp, UNKNOWN_LOCATION); - else - *walk_subtrees = 0; - return NULL_TREE; -} - -/* Return the expression tree EXPR unshared and with location stripped off. */ - -static tree -prune_expression_for_jf (tree exp) -{ - if (EXPR_P (exp)) - { - exp = unshare_expr (exp); - walk_tree (&exp, prune_expression_for_jf_1, NULL, NULL); - } - return exp; -} - /* Set JFUNC to be a known type jump function. */ static void @@ -341,7 +316,7 @@ ipa_set_jf_constant (struct ipa_jump_func *jfunc, tree constant) if (constant && EXPR_P (constant)) SET_EXPR_LOCATION (constant, UNKNOWN_LOCATION); jfunc->type = IPA_JF_CONST; - jfunc->value.constant = prune_expression_for_jf (constant); + jfunc->value.constant = unshare_expr_without_location (constant); } /* Set JFUNC to be a simple pass-through jump function. */ @@ -363,7 +338,7 @@ ipa_set_jf_arith_pass_through (struct ipa_jump_func *jfunc, int formal_id, tree operand, enum tree_code operation) { jfunc->type = IPA_JF_PASS_THROUGH; - jfunc->value.pass_through.operand = prune_expression_for_jf (operand); + jfunc->value.pass_through.operand = unshare_expr_without_location (operand); jfunc->value.pass_through.formal_id = formal_id; jfunc->value.pass_through.operation = operation; jfunc->value.pass_through.agg_preserved = false; @@ -1385,7 +1360,7 @@ determine_known_aggregate_parts (gimple call, tree arg, { struct ipa_agg_jf_item item; item.offset = list->offset - arg_offset; - item.value = prune_expression_for_jf (list->constant); + item.value = unshare_expr_without_location (list->constant); jfunc->agg.items->quick_push (item); } list = list->next; |