aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-05-01 17:51:56 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2007-05-01 17:51:56 +0000
commite1f28918efd6b999478fa903e355115aa6e2bff8 (patch)
treef7a8af69e45e5ad8e7e93f96d73f79730bedcfd9 /gcc/tree.c
parent1d87d70dd03280f2bf8d30a2695a3828152607cc (diff)
downloadgcc-e1f28918efd6b999478fa903e355115aa6e2bff8.zip
gcc-e1f28918efd6b999478fa903e355115aa6e2bff8.tar.gz
gcc-e1f28918efd6b999478fa903e355115aa6e2bff8.tar.bz2
re PR tree-optimization/31739 (ICE at tree.c:902 compiling g-regexp.adb)
PR tree-optimization/31739 * tree-vrp.c (vrp_val_is_max): New static function. (vrp_val_is_min): New static function. (set_value_range_to_value): Use TYPE_{MAX,MIN}_VALUE rather than copying the node. (set_value_range): Use vrp_val_is_{max,min}. (extract_range_from_assert): Likewise. (extract_range_from_binary_expr): Likewise. (extract_range_from_unary_expr): Likewise. (dump_value_range, vrp_meet): Likewise. (vrp_visit_phi_node): Likewise. * tree.c (build_distinct_type_copy): Revert change of 2007-04-27. From-SVN: r124334
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 472477c..b636de6 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -4173,15 +4173,10 @@ build_distinct_type_copy (tree type)
/* Make it its own variant. */
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));
- }
+
+ /* Note that it is now possible for TYPE_MIN_VALUE to be a value
+ whose TREE_TYPE is not t. This can also happen in the Ada
+ frontend when using subtypes. */
return t;
}