From: Richard Biener Date: Mon, 6 Jul 2015 10:37:33 +0000 (+0000) Subject: re PR tree-optimization/66759 (ICE in generic-match.c on 456.hmmer) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0409237b686b5daa66810427652acd53761d270b;p=gcc.git re PR tree-optimization/66759 (ICE in generic-match.c on 456.hmmer) 2015-07-06 Richard Biener PR middle-end/66759 * match.pd: Add missing constraint of y to REAL_CST in REAL_CST - x CMP y to y - CST CMP x simplification. * gcc.dg/torture/pr66759.c: New testcase. From-SVN: r225449 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 234468c71a1..5e7108a6479 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-07-06 Richard Biener + + PR middle-end/66759 + * match.pd: Add missing constraint of y to REAL_CST in + REAL_CST - x CMP y to y - CST CMP x simplification. + 2015-07-06 Eric Botcazou PR tree-optimization/66757 diff --git a/gcc/match.pd b/gcc/match.pd index ae0d9f11134..f850d523265 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -1497,7 +1497,7 @@ along with GCC; see the file COPYING3. If not see floating-point types only if -fassociative-math is set. */ (if (flag_associative_math) (simplify - (cmp (minus REAL_CST@0 @1) @2) + (cmp (minus REAL_CST@0 @1) REAL_CST@2) (with { tree tem = const_binop (MINUS_EXPR, TREE_TYPE (@1), @0, @2); } (if (!TREE_OVERFLOW (tem)) (cmp { tem; } @1))))) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d51e6068a6e..efe389df056 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-07-06 Richard Biener + + PR middle-end/66759 + * gcc.dg/torture/pr66759.c: New testcase. + 2015-07-06 Andre Vehreschild PR fortran/58586 diff --git a/gcc/testsuite/gcc.dg/torture/pr66759.c b/gcc/testsuite/gcc.dg/torture/pr66759.c new file mode 100644 index 00000000000..3e5d720ee1f --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr66759.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-ffast-math" } */ + +int a, b; +float c; +int fn2(); +void fn1() +{ + if (fn2() <= 1. - c) + b = a; +}