aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2012-09-19 23:46:47 +0200
committerMartin Jambor <jamborm@gcc.gnu.org>2012-09-19 23:46:47 +0200
commit7f7c81909221af5c3c4e6ffad404207c29ea953d (patch)
treebb0b686895f3b5d0f65cba569449e90d39a49d03 /gcc
parentd91491e5160627426adfb804c2ac54610c650ed1 (diff)
downloadgcc-7f7c81909221af5c3c4e6ffad404207c29ea953d.zip
gcc-7f7c81909221af5c3c4e6ffad404207c29ea953d.tar.gz
gcc-7f7c81909221af5c3c4e6ffad404207c29ea953d.tar.bz2
ipa-prop.c (prune_expression_for_jf): New function.
2012-09-19 Martin Jambor <mjambor@suse.cz> * ipa-prop.c (prune_expression_for_jf): New function. (ipa_set_jf_constant): Use it. (ipa_set_jf_arith_pass_through): Likewise. (determine_known_aggregate_parts): Likewise. From-SVN: r191502
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/ipa-prop.c19
2 files changed, 23 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5fdfc47..3fa4516 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2012-09-19 Martin Jambor <mjambor@suse.cz>
+
+ * ipa-prop.c (prune_expression_for_jf): New function.
+ (ipa_set_jf_constant): Use it.
+ (ipa_set_jf_arith_pass_through): Likewise.
+ (determine_known_aggregate_parts): Likewise.
+
2012-09-19 Steve Ellcey <sellcey@mips.com>
* config.gcc (mips*-mti-elf*): New target.
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 13538d7..8f3cf72 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -287,6 +287,19 @@ ipa_print_all_jump_functions (FILE *f)
}
}
+/* 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);
+ SET_EXPR_LOCATION (exp, UNKNOWN_LOCATION);
+ }
+ return exp;
+}
+
/* Set JFUNC to be a known type jump function. */
static void
@@ -308,7 +321,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 = constant;
+ jfunc->value.constant = prune_expression_for_jf (constant);
}
/* Set JFUNC to be a simple pass-through jump function. */
@@ -330,7 +343,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 = operand;
+ jfunc->value.pass_through.operand = prune_expression_for_jf (operand);
jfunc->value.pass_through.formal_id = formal_id;
jfunc->value.pass_through.operation = operation;
jfunc->value.pass_through.agg_preserved = false;
@@ -1347,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 = list->constant;
+ item.value = prune_expression_for_jf (list->constant);
VEC_quick_push (ipa_agg_jf_item_t, jfunc->agg.items, item);
}
list = list->next;