https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128458

            Bug ID: 128458
           Summary: wrong-code with reassoc and powers of _Float64
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

extern double pow (double, double);

__attribute__((noipa)) _Float64
f (_Float64 x)
{
  return x * x * pow (x, 3.0);
}

int
main (void)
{
  if (f (2) != 32)
    __builtin_abort ();
  return 0;
}


with -Ofast reassoc handles the pow() call as if it can be replaced with powi
but as it fails it simply replaces it with 'x', dropping the power to 3.

Reply via email to