tree-vrp.c (simplify_conversion_using_ranges): Make sure the final type is integral.
authorRichard Guenther <rguenther@suse.de>
Wed, 13 Jul 2011 10:32:55 +0000 (10:32 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 13 Jul 2011 10:32:55 +0000 (10:32 +0000)
2011-07-13  Richard Guenther  <rguenther@suse.de>

* tree-vrp.c (simplify_conversion_using_ranges): Make sure
the final type is integral.

* gcc.dg/torture/20110713-1.c: New testcase.

From-SVN: r176227

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/20110713-1.c [new file with mode: 0644]
gcc/tree-vrp.c

index 3e604c4652d71c0f04c2984c7d7fe3b32aafe4bb..0ece8d2be76e50c496686772d1369add8034522f 100644 (file)
@@ -1,3 +1,8 @@
+2011-07-13  Richard Guenther  <rguenther@suse.de>
+
+       * tree-vrp.c (simplify_conversion_using_ranges): Make sure
+       the final type is integral.
+
 2011-07-13  Bernd Schmidt  <bernds@codesourcery.com>
 
        * sched-int.h (struct _dep): Add member cost.
index 5d1cab63c7c28e00a9edc9f590b72a8a5bdead48..58b59318089d8edf6f319deb5b8dada4fac73b7a 100644 (file)
@@ -1,3 +1,7 @@
+2011-07-13  Richard Guenther  <rguenther@suse.de>
+
+       * gcc.dg/torture/20110713-1.c: New testcase.
+
 2011-07-12  Andrew Pinski  <pinskia@gmail.com>
 
        PR rtl-opt/49474
diff --git a/gcc/testsuite/gcc.dg/torture/20110713-1.c b/gcc/testsuite/gcc.dg/torture/20110713-1.c
new file mode 100644 (file)
index 0000000..aa446af
--- /dev/null
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+
+void *
+test (unsigned long long x, unsigned long long y)
+{
+    return (void *) (unsigned int) (x / y);
+}
index c975a5d0466d971e9b642e04893b09ab249106a1..89b1533d2b76576bda01b019fb326b9d46954c89 100644 (file)
@@ -7353,6 +7353,8 @@ simplify_conversion_using_ranges (gimple stmt)
   double_int innermin, innermax, middlemin, middlemax;
 
   finaltype = TREE_TYPE (gimple_assign_lhs (stmt));
+  if (!INTEGRAL_TYPE_P (finaltype))
+    return false;
   middleop = gimple_assign_rhs1 (stmt);
   def_stmt = SSA_NAME_DEF_STMT (middleop);
   if (!is_gimple_assign (def_stmt)