-2017-11-15 Qing Zhao <qing.zhao@oracle.com>
+2017-11-17 Richard Biener <rguenther@suse.de>
+
+ * tree-ssa-pre.c (phi_translate_1): Remove redundant constant
+ folding of references.
+
+2017-11-17 Qing Zhao <qing.zhao@oracle.com>
PR middle-end/78809
* gimple-fold.c (gimple_fold_builtin_string_compare): Add handling
if (changed || newvuse != vuse)
{
unsigned int new_val_id;
- pre_expr constant;
tree result = vn_reference_lookup_pieces (newvuse, ref->set,
ref->type,
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)
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 ();