re PR tree-optimization/61184 (wrong code (that hangs) by LTO on x86_64-linux-gnu)

2014-05-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/61184
	* tree-vrp.c (is_negative_overflow_infinity): Use
	TREE_OVERFLOW_P and do that check first.
	(is_positive_overflow_infinity): Likewise.
	(is_overflow_infinity): Likewise.
	(vrp_operand_equal_p): Properly treat operands with
	differing overflow as not equal.

	* c-c++-common/torture/pr61184.c: New testcase.

From-SVN: r210611
This commit is contained in:
Richard Biener 2014-05-19 12:32:15 +00:00 committed by Richard Biener
parent bddd36713d
commit cb460086e1
4 changed files with 40 additions and 12 deletions

View File

@ -1,3 +1,13 @@
2014-05-19 Richard Biener <rguenther@suse.de>
PR tree-optimization/61184
* tree-vrp.c (is_negative_overflow_infinity): Use
TREE_OVERFLOW_P and do that check first.
(is_positive_overflow_infinity): Likewise.
(is_overflow_infinity): Likewise.
(vrp_operand_equal_p): Properly treat operands with
differing overflow as not equal.
2014-05-19 Bernd Schmidt <bernds@codesourcery.com>
* simplify-rtx.c (simplify_unary_operation_1): Use CONST_INT_P in

View File

@ -1,3 +1,8 @@
2014-05-19 Richard Biener <rguenther@suse.de>
PR tree-optimization/61184
* c-c++-common/torture/pr61184.c: New testcase.
2014-05-19 Christian Bruel <christian.bruel@st.com>
PR target/61195

View File

@ -0,0 +1,18 @@
/* { dg-do run } */
/* { dg-additional-options "-fno-strict-overflow" } */
short a;
void
foo (void)
{
for (a = 0; a >= 0; a++)
;
}
int
main ()
{
foo ();
return 0;
}

View File

@ -293,9 +293,8 @@ positive_overflow_infinity (tree type)
static inline bool
is_negative_overflow_infinity (const_tree val)
{
return (needs_overflow_infinity (TREE_TYPE (val))
&& CONSTANT_CLASS_P (val)
&& TREE_OVERFLOW (val)
return (TREE_OVERFLOW_P (val)
&& needs_overflow_infinity (TREE_TYPE (val))
&& vrp_val_is_min (val));
}
@ -304,9 +303,8 @@ is_negative_overflow_infinity (const_tree val)
static inline bool
is_positive_overflow_infinity (const_tree val)
{
return (needs_overflow_infinity (TREE_TYPE (val))
&& CONSTANT_CLASS_P (val)
&& TREE_OVERFLOW (val)
return (TREE_OVERFLOW_P (val)
&& needs_overflow_infinity (TREE_TYPE (val))
&& vrp_val_is_max (val));
}
@ -315,9 +313,8 @@ is_positive_overflow_infinity (const_tree val)
static inline bool
is_overflow_infinity (const_tree val)
{
return (needs_overflow_infinity (TREE_TYPE (val))
&& CONSTANT_CLASS_P (val)
&& TREE_OVERFLOW (val)
return (TREE_OVERFLOW_P (val)
&& needs_overflow_infinity (TREE_TYPE (val))
&& (vrp_val_is_min (val) || vrp_val_is_max (val)));
}
@ -791,9 +788,7 @@ vrp_operand_equal_p (const_tree val1, const_tree val2)
return true;
if (!val1 || !val2 || !operand_equal_p (val1, val2, 0))
return false;
if (is_overflow_infinity (val1))
return is_overflow_infinity (val2);
return true;
return is_overflow_infinity (val1) == is_overflow_infinity (val2);
}
/* Return true, if the bitmaps B1 and B2 are equal. */