aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2008-02-05 11:31:20 -0500
committerDiego Novillo <dnovillo@gcc.gnu.org>2008-02-05 11:31:20 -0500
commitc1e7d240125d4927db2f87df874e2133d0e63ba9 (patch)
tree381dc8fbf6b7e9978afb8ed9677ef95490311161 /gcc
parent3a2041755b4ec15331bff0d7b60d545eeb6171a9 (diff)
downloadgcc-c1e7d240125d4927db2f87df874e2133d0e63ba9.zip
gcc-c1e7d240125d4927db2f87df874e2133d0e63ba9.tar.gz
gcc-c1e7d240125d4927db2f87df874e2133d0e63ba9.tar.bz2
http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00140.html
PR 33738 * tree-vrp.c (vrp_evaluate_conditional): Revert fix for PR 33738. testsuite/ChangeLog PR 33738 * g++.dg/warn/pr33738.C: Remove. From-SVN: r132124
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/g++.dg/warn/pr33738.C26
-rw-r--r--gcc/tree-vrp.c42
4 files changed, 15 insertions, 68 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 84c0856..95da033 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2008-02-05 Diego Novillo <dnovillo@google.com>
+
+ http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00140.html
+
+ PR 33738
+ * tree-vrp.c (vrp_evaluate_conditional): Revert fix for
+ PR 33738.
+
2008-02-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
PR other/35070
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index daf3f07..8434064 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2008-02-05 Diego Novillo <dnovillo@google.com>
+
+ http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00140.html
+
+ PR 33738
+ * g++.dg/warn/pr33738.C: Remove.
+
2008-02-05 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34945
diff --git a/gcc/testsuite/g++.dg/warn/pr33738.C b/gcc/testsuite/g++.dg/warn/pr33738.C
deleted file mode 100644
index 8847b6e3..0000000
--- a/gcc/testsuite/g++.dg/warn/pr33738.C
+++ /dev/null
@@ -1,26 +0,0 @@
-// { dg-do run }
-// { dg-options "-O2 -Wtype-limits" }
-extern void link_error (void);
-
-enum Alpha {
- ZERO = 0, ONE, TWO, THREE
-};
-
-Alpha a2;
-
-int m1 = -1;
-int GetM1() {
- return m1;
-}
-
-int main() {
- a2 = static_cast<Alpha>(GetM1());
- if (a2 == -1) { // { dg-warning "always false due" }
- link_error ();
- }
- if (-1 == a2) { // { dg-warning "always false due" }
- link_error ();
- }
- return 0;
-}
-
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 9b9cc03..5f9a327 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -5073,48 +5073,6 @@ vrp_evaluate_conditional (tree cond, tree stmt)
}
}
- if (warn_type_limits
- && ret
- && TREE_CODE_CLASS (TREE_CODE (cond)) == tcc_comparison)
- {
- /* If the comparison is being folded and the operand on the LHS
- is being compared against a constant value that is outside of
- the natural range of OP0's type, then the predicate will
- always fold regardless of the value of OP0. If -Wtype-limits
- was specified, emit a warning. */
- const char *warnmsg = NULL;
- tree op0 = TREE_OPERAND (cond, 0);
- tree op1 = TREE_OPERAND (cond, 1);
- tree type = TREE_TYPE (op0);
- value_range_t *vr0 = get_value_range (op0);
-
- if (vr0->type != VR_VARYING
- && INTEGRAL_TYPE_P (type)
- && vrp_val_is_min (vr0->min)
- && vrp_val_is_max (vr0->max)
- && is_gimple_min_invariant (op1))
- {
- if (integer_zerop (ret))
- warnmsg = G_("comparison always false due to limited range of "
- "data type");
- else
- warnmsg = G_("comparison always true due to limited range of "
- "data type");
- }
-
- if (warnmsg)
- {
- location_t locus;
-
- if (!EXPR_HAS_LOCATION (stmt))
- locus = input_location;
- else
- locus = EXPR_LOCATION (stmt);
-
- warning (OPT_Wextra, "%H%s", &locus, warnmsg);
- }
- }
-
return ret;
}