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
This commit is contained in:
Jakub Jelinek 2008-10-16 14:32:01 +02:00 committed by Jakub Jelinek
parent 5773a50f41
commit a39562d944
4 changed files with 25 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2008-10-16 Jakub Jelinek <jakub@redhat.com>
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 <edelsohn@gnu.org>
PR target/35483

View File

@ -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)))
{

View File

@ -1,3 +1,8 @@
2008-10-16 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/37664
* gcc.c-torture/compile/pr37664.c: New test.
2008-10-16 Joseph Myers <joseph@codesourcery.com>
PR middle-end/37418

View File

@ -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;
}