re PR tree-optimization/80788 (ICE in set_value_range, at tree-vrp.c:252)

PR tree-optimization/80788
	* match.pd (X +- C1 CMP C2 -> X CMP C2 -+ C1): If res
	has TREE_OVERFLOW set, call drop_tree_overflow.

	* gcc.dg/pr80788.c: New test.

From-SVN: r255191
This commit is contained in:
Jakub Jelinek 2017-11-28 09:40:36 +01:00 committed by Jakub Jelinek
parent 6a7a7f92bd
commit 11c1e63c90
4 changed files with 26 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2017-11-28 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/80788
* match.pd (X +- C1 CMP C2 -> X CMP C2 -+ C1): If res
has TREE_OVERFLOW set, call drop_tree_overflow.
2017-11-28 Richard Biener <rguenther@suse.de>
PR tree-optimization/83158

View File

@ -4393,7 +4393,8 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
&& TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (@0)))
{ constant_boolean_node (cmp == NE_EXPR, type); }
(if (single_use (@3))
(cmp @0 { res; }))))))))
(cmp @0 { TREE_OVERFLOW (res)
? drop_tree_overflow (res) : res; }))))))))
(for cmp (lt le gt ge)
(for op (plus minus)
rop (minus plus)

View File

@ -1,3 +1,8 @@
2017-11-28 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/80788
* gcc.dg/pr80788.c: New test.
2017-11-27 Martin Sebor <msebor@redhat.com>
PR c++/83058

View File

@ -0,0 +1,13 @@
/* PR tree-optimization/80788 */
/* { dg-do compile } */
/* { dg-options "-O2 -fwrapv" } */
void
foo (signed char x)
{
signed char a = (x + 1) ^ 128;
x &= !!a;
if (x != 0)
for (;;)
;
}