This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/50066] [4.7 Regression] Bad signed int to unsigned long long conversion
- From: "hjl.tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 13 Aug 2011 16:33:19 +0000
- Subject: [Bug middle-end/50066] [4.7 Regression] Bad signed int to unsigned long long conversion
- Auto-submitted: auto-generated
- References: <bug-50066-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50066
--- Comment #9 from H.J. Lu <hjl.tools at gmail dot com> 2011-08-13 16:33:19 UTC ---
Shouldn't we check TREE_OVERFLOW:
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index df7a9a2..4ec7e5b 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -7263,6 +7263,8 @@ simplify_conversion_using_ranges (gimple stmt)
/* Get the value-range of the inner operand. */
innervr = get_value_range (innerop);
if (innervr->type != VR_RANGE
+ || TREE_OVERFLOW (innervr->min)
+ || TREE_OVERFLOW (innervr->max)
|| TREE_CODE (innervr->min) != INTEGER_CST
|| TREE_CODE (innervr->max) != INTEGER_CST)
return false;