[Bug tree-optimization/84334] [8 Regression] Stack overflow with -Ofast -frounding-math

2018-02-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84334

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Jakub Jelinek  ---
Fixed.

[Bug tree-optimization/84334] [8 Regression] Stack overflow with -Ofast -frounding-math

2018-02-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84334

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Thu Feb 15 11:17:05 2018
New Revision: 257683

URL: https://gcc.gnu.org/viewcvs?rev=257683&root=gcc&view=rev
Log:
PR tree-optimization/84334
* match.pd ((A +- CST1) +- CST2 -> A + CST3): If A is
also a CONSTANT_CLASS_P, punt.

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

Added:
trunk/gcc/testsuite/gcc.dg/pr84334.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/match.pd
trunk/gcc/testsuite/ChangeLog

[Bug tree-optimization/84334] [8 Regression] Stack overflow with -Ofast -frounding-math

2018-02-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84334

--- Comment #3 from Jakub Jelinek  ---
Created attachment 43403
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43403&action=edit
gcc8-pr84334.patch

Untested fix.

[Bug tree-optimization/84334] [8 Regression] Stack overflow with -Ofast -frounding-math

2018-02-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84334

Jakub Jelinek  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org

[Bug tree-optimization/84334] [8 Regression] Stack overflow with -Ofast -frounding-math

2018-02-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84334

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-02-13
 CC||jakub at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Jakub Jelinek  ---
Indeed, this is on
_1434 = 9.99974752427078783512115478515625e-7 +
1.4950485415756702423095703125e-6;
_164 = _1434 + 4.99873689375817775726318359375e-6;

Reduced testcase:
/* PR tree-optimization/84334 */
/* { dg-do compile } */
/* { dg-options "-Ofast -frounding-math" } */

float
foo (void)
{
  float a = 9.99974752427078783512115478515625e-7f;
  float b = 1.4950485415756702423095703125e-6f;
  float c = 4.99873689375817775726318359375e-6f;
  return a + b + c;
}

[Bug tree-optimization/84334] [8 Regression] Stack overflow with -Ofast -frounding-math

2018-02-12 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84334

--- Comment #1 from Marc Glisse  ---
With -frounding-math, CCP produces things like:

  _465 = 9.99974752427078783512115478515625e-7 +
4.99873689375817775726318359375e-6;

Guessing:
When we have cst1+cst2+cst3, the transformation gives cst1+(cst2+cst3), where
cst2+cst3 does not simplify because of -frounding-math, so it is transformed
again to cst2+(cst1+cst3) or similar, and we cycle. We should not transform
when cst2+cst3 will not simplify (I think there have been similar issues
recently).

I can't test or debug anything for a couple weeks, so I may be completely
wrong.

-Ofast -frounding-math makes little sense to me.

[Bug tree-optimization/84334] [8 Regression] Stack overflow with -Ofast -frounding-math

2018-02-12 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84334

Martin Liška  changed:

   What|Removed |Added

   Priority|P3  |P1
  Known to work||7.2.0
   Target Milestone|--- |8.0
  Known to fail||8.0