Commit 75473a91 by Richard Biener Committed by Richard Biener

re PR middle-end/79818 (wrong code with -fwrapv and -Os/-O1/-O2/-O3)

2017-03-03  Richard Biener  <rguenther@suse.de>

	PR middle-end/79818
	* match.pd ( X +- C1 CMP C2 -> X CMP C2 -+ C1): Add missing
	TYPE_OVERFLOW_UNDEFINED check.

	* gcc.dg/torture/pr79818.c: New testcase.

From-SVN: r245860
parent fb5ce608
2017-03-03 Richard Biener <rguenther@suse.de>
PR middle-end/79818
* match.pd ( X +- C1 CMP C2 -> X CMP C2 -+ C1): Add missing
TYPE_OVERFLOW_UNDEFINED check.
2017-03-02 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* config/rs6000/vector.md (vector_ne_<mode>_p): Correct operand
......
......@@ -3688,7 +3688,8 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
&& !TYPE_OVERFLOW_TRAPS (TREE_TYPE (@0))
&& !TYPE_SATURATING (TREE_TYPE (@0)))
(with { tree res = int_const_binop (rop, @2, @1); }
(if (TREE_OVERFLOW (res))
(if (TREE_OVERFLOW (res)
&& TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (@0)))
{ constant_boolean_node (cmp == NE_EXPR, type); }
(if (single_use (@3))
(cmp @0 { res; }))))))))
......
2017-03-03 Richard Biener <rguenther@suse.de>
PR middle-end/79818
* gcc.dg/torture/pr79818.c: New testcase.
2017-03-02 Jakub Jelinek <jakub@redhat.com>
PR c++/79782
......
/* { dg-do run } */
/* { dg-additional-options "-fwrapv" } */
static void __attribute__((noinline,noclone))
func(void)
{
signed char c = 0;
for(; c >= 0; c++);
if(c != -128)
__builtin_abort();
}
int main(int argc, char* argv[])
{
func();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment