diff options
author | Richard Guenther <rguenther@suse.de> | 2010-03-11 15:08:24 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-03-11 15:08:24 +0000 |
commit | ff0a0c1d883427293cc007f273ad6f9a31b511a6 (patch) | |
tree | 058f274db42ab784343a4873e9bb47a39dae898a | |
parent | b509e1fcea9c6ba2dcaaee5159e19f65b407f031 (diff) | |
download | gcc-ff0a0c1d883427293cc007f273ad6f9a31b511a6.zip gcc-ff0a0c1d883427293cc007f273ad6f9a31b511a6.tar.gz gcc-ff0a0c1d883427293cc007f273ad6f9a31b511a6.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr43255.c | 33 | ||||
-rw-r--r-- | gcc/tree-vrp.c | 4 |
4 files changed, 48 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5e07486..a6fc80d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +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> PR tree-optimization/43280 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fc9f8e6..9a8709a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +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> * gcc.dg/optimize-bswapdi-1.c: Add OpenSSL bswap variant. diff --git a/gcc/testsuite/gcc.c-torture/compile/pr43255.c b/gcc/testsuite/gcc.c-torture/compile/pr43255.c new file mode 100644 index 0000000..1b53846 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr43255.c @@ -0,0 +1,33 @@ +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) + { + } +} + + diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 152d389..0071e82 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -4836,6 +4836,10 @@ process_assert_insertions_for (tree name, assert_locus_t loc) edge_iterator ei; 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); assert_stmt = build_assert_expr_for (cond, name); if (loc->e) |