+2017-02-22 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/79673
+ * tree-ssa-pre.c (compute_avail): Use wide_int_to_tree to
+ convert the [TARGET_]MEM_REF offset INTEGER_CST, scrapping off
+ irrelevant address-space qualifiers and avoiding a
+ ADDR_SPACE_CONVERT_EXPR from fold_convert.
+
2017-02-22 Richard Biener <rguenther@suse.de>
PR tree-optimization/79666
+2017-02-22 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/79673
+ * gcc.target/i386/pr79673.c: New testcase.
+
2017-02-22 Richard Biener <rguenther@suse.de>
PR tree-optimization/79666
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void used(double x);
+void usel(long x);
+void test(int c)
+{
+ if (c)
+ used(*((double __seg_gs *) 0));
+ else
+ usel(*((long __seg_gs *) 0));
+}
{
ref->set = set;
if (ref1->opcode == MEM_REF)
- ref1->op0 = fold_convert (TREE_TYPE (ref2->op0),
- ref1->op0);
+ ref1->op0 = wide_int_to_tree (TREE_TYPE (ref2->op0),
+ ref1->op0);
else
- ref1->op2 = fold_convert (TREE_TYPE (ref2->op2),
- ref1->op2);
+ ref1->op2 = wide_int_to_tree (TREE_TYPE (ref2->op2),
+ ref1->op2);
}
else
{
ref->set = 0;
if (ref1->opcode == MEM_REF)
- ref1->op0 = fold_convert (ptr_type_node,
- ref1->op0);
+ ref1->op0 = wide_int_to_tree (ptr_type_node,
+ ref1->op0);
else
- ref1->op2 = fold_convert (ptr_type_node,
- ref1->op2);
+ ref1->op2 = wide_int_to_tree (ptr_type_node,
+ ref1->op2);
}
operands.release ();