From c5e8a8c94a7f2e87b7b12f42cfda68a40ac58491 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Fri, 17 Nov 2017 09:06:54 +0000 Subject: [PATCH] tree-ssa-pre.c (phi_translate_1): Remove redundant constant folding of references. 2017-11-17 Richard Biener * tree-ssa-pre.c (phi_translate_1): Remove redundant constant folding of references. From-SVN: r254858 --- gcc/ChangeLog | 7 ++++++- gcc/tree-ssa-pre.c | 18 +++--------------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 165c5c976aa..e07b3e6d175 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,4 +1,9 @@ -2017-11-15 Qing Zhao +2017-11-17 Richard Biener + + * tree-ssa-pre.c (phi_translate_1): Remove redundant constant + folding of references. + +2017-11-17 Qing Zhao PR middle-end/78809 * gimple-fold.c (gimple_fold_builtin_string_compare): Add handling diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 281f100ada2..ecc348436ff 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -1566,7 +1566,6 @@ phi_translate_1 (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2, if (changed || newvuse != vuse) { unsigned int new_val_id; - pre_expr constant; tree result = vn_reference_lookup_pieces (newvuse, ref->set, ref->type, @@ -1611,15 +1610,7 @@ phi_translate_1 (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2, expr->id = 0; if (newref) - { - PRE_EXPR_REFERENCE (expr) = newref; - constant = fully_constant_expression (expr); - if (constant != expr) - return constant; - - new_val_id = newref->value_id; - get_or_alloc_expression_id (expr); - } + new_val_id = newref->value_id; else { if (changed || !same_valid) @@ -1637,12 +1628,9 @@ phi_translate_1 (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2, newoperands, result, new_val_id); newoperands = vNULL; - PRE_EXPR_REFERENCE (expr) = newref; - constant = fully_constant_expression (expr); - if (constant != expr) - return constant; - get_or_alloc_expression_id (expr); } + PRE_EXPR_REFERENCE (expr) = newref; + get_or_alloc_expression_id (expr); add_to_value (new_val_id, expr); } newoperands.release (); -- 2.30.2