diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-09-02 13:48:11 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-09-02 13:48:11 +0000 |
commit | ca9e4658484fe6bffb4f4e29ff17d80d51daa96a (patch) | |
tree | 32d10dcbf13033544a6e54f90e9631d112fa804b /gcc/tree-vrp.c | |
parent | 7bfeabaff564318438e58cc5818b3feb5ec94bef (diff) | |
download | gcc-ca9e4658484fe6bffb4f4e29ff17d80d51daa96a.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139890 138bc75d-0d04-0410-961f-82ee72b054a4
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 348382ecae3..8db35ca42d9 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, |