From: Jakub Jelinek Date: Thu, 16 Oct 2008 12:32:01 +0000 (+0200) Subject: re PR tree-optimization/37664 (ice in remove_range_assertions, at tree-vrp.c:5116) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a39562d94418f27cbf1ad25c24015bd9c2a0de17;p=gcc.git re PR tree-optimization/37664 (ice in remove_range_assertions, at tree-vrp.c:5116) PR tree-optimization/37664 * fold-const.c (fold_binary): When optimizing comparison with highest or lowest type's value, don't consider TREE_OVERFLOW. * gcc.c-torture/compile/pr37664.c: New test. From-SVN: r141171 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 13d987a712c..b242191716b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-10-16 Jakub Jelinek + + PR tree-optimization/37664 + * fold-const.c (fold_binary): When optimizing comparison with + highest or lowest type's value, don't consider TREE_OVERFLOW. + 2008-10-16 David Edelsohn PR target/35483 diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 0ce122a1554..605caa812e0 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -12447,7 +12447,6 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) unsigned int width = TYPE_PRECISION (arg1_type); if (TREE_CODE (arg1) == INTEGER_CST - && !TREE_OVERFLOW (arg1) && width <= 2 * HOST_BITS_PER_WIDE_INT && (INTEGRAL_TYPE_P (arg1_type) || POINTER_TYPE_P (arg1_type))) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dd4544b6155..9148684b63c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-10-16 Jakub Jelinek + + PR tree-optimization/37664 + * gcc.c-torture/compile/pr37664.c: New test. + 2008-10-16 Joseph Myers PR middle-end/37418 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37664.c b/gcc/testsuite/gcc.c-torture/compile/pr37664.c new file mode 100644 index 00000000000..cf5c83d7b2d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr37664.c @@ -0,0 +1,14 @@ +/* PR tree-optimization/37664 */ + +int v; + +int +foo () +{ + int a = 0x8899A862; + int b = 0x8E * a; + int c = (b % b); + if (v > (4294967295U >> c)) + return v; + return 0; +}