From 9111c715537d8ea0829d6ab7511017ed8658f303 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Wed, 13 Jul 2011 10:32:55 +0000 Subject: [PATCH] tree-vrp.c (simplify_conversion_using_ranges): Make sure the final type is integral. 2011-07-13 Richard Guenther * 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 | 5 +++++ gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/torture/20110713-1.c | 8 ++++++++ gcc/tree-vrp.c | 2 ++ 4 files changed, 19 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/torture/20110713-1.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3e604c4652d..0ece8d2be76 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-07-13 Richard Guenther + + * tree-vrp.c (simplify_conversion_using_ranges): Make sure + the final type is integral. + 2011-07-13 Bernd Schmidt * sched-int.h (struct _dep): Add member cost. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5d1cab63c7c..58b59318089 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2011-07-13 Richard Guenther + + * gcc.dg/torture/20110713-1.c: New testcase. + 2011-07-12 Andrew Pinski 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 index 00000000000..aa446af596f --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/20110713-1.c @@ -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); +} diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index c975a5d0466..89b1533d2b7 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -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) -- 2.30.2