Commit ff0a0c1d by Richard Guenther Committed by Richard Biener

re PR middle-end/43255 (ICE in extract_range_from_assert, at tree-vrp.c:1423)

2010-03-11  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/43255
	* tree-vrp.c (process_assert_insertions_for): Do not insert
	asserts for trivial conditions.

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

From-SVN: r157388
parent b509e1fc
2010-03-11 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43255
* tree-vrp.c (process_assert_insertions_for): Do not insert
asserts for trivial conditions.
2010-03-11 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> 2010-03-11 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
PR tree-optimization/43280 PR tree-optimization/43280
......
2010-03-11 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43255
* gcc.c-torture/compile/pr43255.c: New testcase.
2010-03-11 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> 2010-03-11 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* gcc.dg/optimize-bswapdi-1.c: Add OpenSSL bswap variant. * gcc.dg/optimize-bswapdi-1.c: Add OpenSSL bswap variant.
......
int safe (int);
static unsigned foo (unsigned ui1, unsigned ui2)
{
return ui1 + ui2;
}
int g_22;
int *volatile g_23 = &g_22;
int **g_282[8][10][1];
int *g_330 = &g_22;
volatile unsigned g_348;
int g_397;
void int32func (const unsigned char p_10)
{
if (foo
(~
(p_10 |
(*g_282[(unsigned long) g_397 % 8][(unsigned) g_22 % 10][g_348 % 1]) ==
(*g_282[(unsigned long) g_397 % 8][(unsigned) g_22 % 10][g_348 % 1])),
1))
{
}
else if (*g_330 >=
safe (*g_23 ^
(**g_282[(unsigned long) g_397 % 8][(unsigned) g_22 % 10]
[g_348 % 1])) & **g_282[8][10][1], 1)
{
}
}
...@@ -4836,6 +4836,10 @@ process_assert_insertions_for (tree name, assert_locus_t loc) ...@@ -4836,6 +4836,10 @@ process_assert_insertions_for (tree name, assert_locus_t loc)
edge_iterator ei; edge_iterator ei;
edge e; edge e;
/* If we have X <=> X do not insert an assert expr for that. */
if (loc->expr == loc->val)
return false;
cond = build2 (loc->comp_code, boolean_type_node, loc->expr, loc->val); cond = build2 (loc->comp_code, boolean_type_node, loc->expr, loc->val);
assert_stmt = build_assert_expr_for (cond, name); assert_stmt = build_assert_expr_for (cond, name);
if (loc->e) if (loc->e)
......
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