Commit ef3b59ac by Richard Biener Committed by Richard Biener

re PR tree-optimization/66894 (wrong code at -Os and above on x86_64-linux-gnu)

2015-07-16  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/66894
	* tree-vrp.c (register_edge_assert_for_2): Fix bad assumption
	about deriving NE_EXPR from truncated values.

	* gcc.dg/torture/pr66894.c: New testcase.

From-SVN: r225870
parent fb0b2914
2015-07-16 Richard Biener <rguenther@suse.de>
PR tree-optimization/66894
* tree-vrp.c (register_edge_assert_for_2): Fix bad assumption
about deriving NE_EXPR from truncated values.
2015-07-16 Martin Liska <mliska@suse.cz>
* alloc-pool.h
......
2015-07-16 Richard Biener <rguenther@suse.de>
PR tree-optimization/66894
* gcc.dg/torture/pr66894.c: New testcase.
2015-07-16 Richard Biener <rguenther@suse.de>
* gcc.dg/tree-ssa/pr21031.c: Adjust.
2015-07-16 Uros Bizjak <ubizjak@gmail.com>
......
/* { dg-do run } */
short a, b;
int
main ()
{
for (; a != 1; a += 3)
{
int c = 0;
for (; c < 2; c++)
if (a)
{
char d = a;
b = d ? 1 / d : 0;
}
else
break;
}
return 0;
}
......@@ -5382,13 +5382,11 @@ register_edge_assert_for_2 (tree name, edge e, gimple_stmt_iterator bsi,
}
else if (CONVERT_EXPR_CODE_P (code))
{
/* For truncating conversions require that the constant
fits in the truncated type if we are going to record
/* For truncating conversions we cannot record
an inequality. */
if (comp_code == NE_EXPR
&& (TYPE_PRECISION (TREE_TYPE (name2))
< TYPE_PRECISION (TREE_TYPE (name)))
&& ! int_fits_type_p (val, TREE_TYPE (name2)))
< TYPE_PRECISION (TREE_TYPE (name))))
continue;
cst = fold_convert (TREE_TYPE (name2), val);
}
......
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