diff options
author | Richard Guenther <rguenther@suse.de> | 2008-09-02 13:48:11 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2008-09-02 13:48:11 +0000 |
commit | a1b969a0d294963e2e2313fc0b71d0c21bbb316b (patch) | |
tree | 32d10dcbf13033544a6e54f90e9631d112fa804b /gcc/tree-vrp.c | |
parent | 7ab5df48711b7763df629810fa754d65d1eebb7c (diff) | |
download | gcc-a1b969a0d294963e2e2313fc0b71d0c21bbb316b.zip gcc-a1b969a0d294963e2e2313fc0b71d0c21bbb316b.tar.gz gcc-a1b969a0d294963e2e2313fc0b71d0c21bbb316b.tar.bz2 |
re PR tree-optimization/37327 (another ice in set_value_range, at tree-vrp.c:397)
2008-09-02 Richard Guenther <rguenther@suse.de>
PR tree-optimization/37327
* tree-vrp.c (register_new_assert_for): Make sure to not have
TREE_OVERFLOW set on the bound.
* gcc.c-torture/compile/pr37327.c: New testcase.
From-SVN: r139890
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r-- | gcc/tree-vrp.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 348382e..8db35ca 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -3785,6 +3785,14 @@ register_new_assert_for (tree name, tree expr, && gimple_code (gsi_stmt (si)) != GIMPLE_SWITCH); #endif + /* Never build an assert comparing against an integer constant with + TREE_OVERFLOW set. This confuses our undefined overflow warning + machinery. */ + if (TREE_CODE (val) == INTEGER_CST + && TREE_OVERFLOW (val)) + val = build_int_cst_wide (TREE_TYPE (val), + TREE_INT_CST_LOW (val), TREE_INT_CST_HIGH (val)); + /* The new assertion A will be inserted at BB or E. We need to determine if the new location is dominated by a previously registered location for A. If we are doing an edge insertion, |