Commit 76dd203e by Richard Biener Committed by Richard Biener

re PR middle-end/79673 (GIMPLE verification fails when compiling code with __seg_gs)

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.

	* gcc.target/i386/pr79673.c: New testcase.

From-SVN: r245649
parent a9c774d2
2017-02-22 Richard Biener <rguenther@suse.de> 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 PR tree-optimization/79666
* tree-vrp.c (extract_range_from_binary_expr_1): Make sure * tree-vrp.c (extract_range_from_binary_expr_1): Make sure
to not symbolically negate if that may introduce undefined to not symbolically negate if that may introduce undefined
......
2017-02-22 Richard Biener <rguenther@suse.de> 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 PR tree-optimization/79666
* gcc.dg/torture/pr79666.c: New testcase. * gcc.dg/torture/pr79666.c: New testcase.
......
/* { 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));
}
...@@ -3986,21 +3986,21 @@ compute_avail (void) ...@@ -3986,21 +3986,21 @@ compute_avail (void)
{ {
ref->set = set; ref->set = set;
if (ref1->opcode == MEM_REF) if (ref1->opcode == MEM_REF)
ref1->op0 = fold_convert (TREE_TYPE (ref2->op0), ref1->op0 = wide_int_to_tree (TREE_TYPE (ref2->op0),
ref1->op0); ref1->op0);
else else
ref1->op2 = fold_convert (TREE_TYPE (ref2->op2), ref1->op2 = wide_int_to_tree (TREE_TYPE (ref2->op2),
ref1->op2); ref1->op2);
} }
else else
{ {
ref->set = 0; ref->set = 0;
if (ref1->opcode == MEM_REF) if (ref1->opcode == MEM_REF)
ref1->op0 = fold_convert (ptr_type_node, ref1->op0 = wide_int_to_tree (ptr_type_node,
ref1->op0); ref1->op0);
else else
ref1->op2 = fold_convert (ptr_type_node, ref1->op2 = wide_int_to_tree (ptr_type_node,
ref1->op2); ref1->op2);
} }
operands.release (); operands.release ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment