Commit 9cb57027 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/37508 (ICE in in simplify_truth_ops_using_ranges, at tree-vrp.c:6334)

2008-09-16  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/37508
	* tree-vrp.c (simplify_truth_ops_using_ranges): Also allow -1.

	* gcc.dg/tree-ssa/pr37508.c: New testcase.

From-SVN: r140387
parent 3a5c03fb
2008-09-16 Richard Guenther <rguenther@suse.de>
PR tree-optimization/37508
* tree-vrp.c (simplify_truth_ops_using_ranges): Also allow -1.
2008-09-15 Kaz Kojima <kkojima@gcc.gnu.org>
* config/sh/sh.md (movsf_ie): Fix length for TARGET_SH2A.
......
2008-09-16 Richard Guenther <rguenther@suse.de>
PR tree-optimization/37508
* gcc.dg/tree-ssa/pr37508.c: New testcase.
2008-09-15 Aldy Hernandez <aldyh@redhat.com>
* g++.old-deja/g++.brendan/crash16.C: Function name is the correct
......
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-vrp1" } */
struct foo1 {
int i:1;
};
struct foo2 {
unsigned i:1;
};
int test1 (struct foo1 *x)
{
if (x->i == 0)
return 1;
else if (x->i == -1)
return 1;
return 0;
}
int test2 (struct foo2 *x)
{
if (x->i == 0)
return 1;
else if (x->i == -1)
return 1;
return 0;
}
int test3 (struct foo1 *x)
{
if (x->i == 0)
return 1;
else if (x->i == 1)
return 1;
return 0;
}
int test4 (struct foo2 *x)
{
if (x->i == 0)
return 1;
else if (x->i == 1)
return 1;
return 0;
}
/* { dg-final { scan-tree-dump-times "Folding" 4 "vrp1" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "vrp1" } } */
......@@ -6331,7 +6331,8 @@ simplify_truth_ops_using_ranges (gimple_stmt_iterator *gsi, gimple stmt)
/* Exclude anything that should have been already folded. */
gcc_assert (rhs_code == EQ_EXPR || rhs_code == NE_EXPR
|| rhs_code == TRUTH_XOR_EXPR);
gcc_assert (integer_zerop (op1) || integer_onep (op1));
gcc_assert (integer_zerop (op1) || integer_onep (op1)
|| integer_all_onesp (op1));
/* Limit the number of cases we have to consider. */
if (rhs_code == EQ_EXPR)
......
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