Commit b0331ccb by Richard Guenther Committed by Richard Biener

re PR tree-optimization/38564 (Revision 142662 caused ICE in insert_into_preds_of_block)

2008-12-30  Richard Guenther  <rguenther@suse.de>

	PR middle-end/38564
	* fold-const.c (fold_comparison): Use the correct result type.

	* gcc.c-torture/compile/pr38564.c: New testcase.

From-SVN: r142961
parent 17213821
2008-12-30 Richard Guenther <rguenther@suse.de>
PR middle-end/38564
* fold-const.c (fold_comparison): Use the correct result type.
2008-12-30 Dorit Nuzman <dorit@il.ibm.com>
Ira Rosen <irar@il.ibm.com>
......@@ -9036,17 +9036,17 @@ fold_comparison (enum tree_code code, tree type, tree op0, tree op1)
switch (code)
{
case EQ_EXPR:
return build_int_cst (boolean_type_node, bitpos0 == bitpos1);
return constant_boolean_node (bitpos0 == bitpos1, type);
case NE_EXPR:
return build_int_cst (boolean_type_node, bitpos0 != bitpos1);
return constant_boolean_node (bitpos0 != bitpos1, type);
case LT_EXPR:
return build_int_cst (boolean_type_node, bitpos0 < bitpos1);
return constant_boolean_node (bitpos0 < bitpos1, type);
case LE_EXPR:
return build_int_cst (boolean_type_node, bitpos0 <= bitpos1);
return constant_boolean_node (bitpos0 <= bitpos1, type);
case GE_EXPR:
return build_int_cst (boolean_type_node, bitpos0 >= bitpos1);
return constant_boolean_node (bitpos0 >= bitpos1, type);
case GT_EXPR:
return build_int_cst (boolean_type_node, bitpos0 > bitpos1);
return constant_boolean_node (bitpos0 > bitpos1, type);
default:;
}
}
......
2008-12-30 Richard Guenther <rguenther@suse.de>
PR middle-end/38564
* gcc.c-torture/compile/pr38564.c: New testcase.
2008-12-29 Dorit Nuzman <dorit@il.ibm.com>
Ira Rosen <irar@il.ibm.com>
......
struct S
{
struct S *n, *p;
} *s;
void bar (void *);
int
foo (int x)
{
struct S p = { &p, &p };
int i;
for (i = 0; i < x; i++)
bar (s);
return p.n == &p;
}
int dialog_calendar(int state)
{
int *obj = (state == 1 ? &state : 0);
return (obj == &state);
}
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