diff options
author | Ian Lance Taylor <iant@google.com> | 2007-04-27 20:47:24 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2007-04-27 20:47:24 +0000 |
commit | 093b203ba9a0b34d78ef2972e687fd5ca03a952b (patch) | |
tree | 006d5c059049f9c0e6cad9983831e3959d447bc6 /gcc/tree.c | |
parent | 30251f7a3a5406def690197174f9769cecf152c8 (diff) | |
download | gcc-093b203ba9a0b34d78ef2972e687fd5ca03a952b.zip gcc-093b203ba9a0b34d78ef2972e687fd5ca03a952b.tar.gz gcc-093b203ba9a0b34d78ef2972e687fd5ca03a952b.tar.bz2 |
re PR middle-end/31710 (ICE in in set_value_range, at tree-vrp.c:278)
./: PR middle-end/31710
* tree.c (build_distinct_type_copy): If TYPE_MIN_VALUE or
TYPE_MAX_VALUE exist, convert them to the new type.
testsuite/:
PR middle-end/31710
* gcc.c-torture/compile/pr31710.c: New test.
From-SVN: r124237
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -4174,6 +4174,15 @@ build_distinct_type_copy (tree type) TYPE_MAIN_VARIANT (t) = t; TYPE_NEXT_VARIANT (t) = 0; + /* VRP assumes that TREE_TYPE (TYPE_MIN_VALUE (type)) == type. */ + if (INTEGRAL_TYPE_P (t) || SCALAR_FLOAT_TYPE_P (t)) + { + if (TYPE_MIN_VALUE (t) != NULL_TREE) + TYPE_MIN_VALUE (t) = fold_convert (t, TYPE_MIN_VALUE (t)); + if (TYPE_MAX_VALUE (t) != NULL_TREE) + TYPE_MAX_VALUE (t) = fold_convert (t, TYPE_MAX_VALUE (t)); + } + return t; } |