diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4a5de9ee59a..0997ef4f312 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-12-09 Richard Biener + + PR middle-end/64199 + * fold-const.c (fold_binary_loc): Use TREE_OVERFLOW_P. + 2014-12-09 Richard Biener PR tree-optimization/64191 diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 94d1cbfc2b2..0c4fe400070 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -10398,8 +10398,8 @@ fold_binary_loc (location_t loc, /* Don't introduce overflows through reassociation. */ if (!any_overflows - && ((lit0 && TREE_OVERFLOW (lit0)) - || (minus_lit0 && TREE_OVERFLOW (minus_lit0)))) + && ((lit0 && TREE_OVERFLOW_P (lit0)) + || (minus_lit0 && TREE_OVERFLOW_P (minus_lit0)))) return NULL_TREE; if (minus_lit0) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 31f740dba87..fbd11360617 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-12-09 Richard Biener + + PR middle-end/64199 + * gcc.dg/torture/pr64199.c: New testcase. + 2014-12-09 Ilya Enkovich * gcc.dg/lto/lto.exp: Load mpx-dg.exp. diff --git a/gcc/testsuite/gcc.dg/torture/pr64199.c b/gcc/testsuite/gcc.dg/torture/pr64199.c new file mode 100644 index 00000000000..e3f1002f1bd --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr64199.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-ffast-math -frounding-math" } */ + +float +foo (void) +{ + return 1.1f + 2.2f + 2.2f; +}