Commit a4ce1258 by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/57331 (ICE: tree check: expected integer_type or…

re PR tree-optimization/57331 (ICE: tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have pointer_type in int_fits_type_p, at tree.c:8437)

	PR tree-optimization/57331
	* tree-vrp.c (simplify_cond_using_ranges): Don't optimize
	comparison of conversion from pointer type to integral type
	with integer.

	* gcc.c-torture/compile/pr57331.c: New test.

From-SVN: r199148
parent f3e4f44c
2013-05-21 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/57331
* tree-vrp.c (simplify_cond_using_ranges): Don't optimize
comparison of conversion from pointer type to integral type
with integer.
2013-05-21 Martin Jambor <mjambor@suse.cz>
PR lto/57289
......
2013-05-21 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/57331
* gcc.c-torture/compile/pr57331.c: New test.
2013-05-21 Richard Biener <rguenther@suse.de>
PR tree-optimization/57330
......
/* PR tree-optimization/57331 */
int
foo (int x)
{
void *p = x ? (void *) 1 : (void *) 0;
__INTPTR_TYPE__ b = (__INTPTR_TYPE__) p;
if (b)
return 0;
return 1;
}
......@@ -8661,7 +8661,8 @@ simplify_cond_using_ranges (gimple stmt)
innerop = gimple_assign_rhs1 (def_stmt);
if (TREE_CODE (innerop) == SSA_NAME)
if (TREE_CODE (innerop) == SSA_NAME
&& !POINTER_TYPE_P (TREE_TYPE (innerop)))
{
value_range_t *vr = get_value_range (innerop);
......
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