Bug 22453 - reload uses FLOAT_REGS class eagerly even if -mfpmath=sse
Summary: reload uses FLOAT_REGS class eagerly even if -mfpmath=sse
Status: RESOLVED DUPLICATE of bug 19653
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: missed-optimization, ra
Depends on:
Blocks:
 
Reported: 2005-07-13 08:15 UTC by Paolo Bonzini
Modified: 2005-07-23 22:49 UTC (History)
3 users (show)

See Also:
Host:
Target: i686-pc-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paolo Bonzini 2005-07-13 08:15:02 UTC
The following code

extern double f(double, double);
void g (double x)
{
  double z, y;

  z = 0.0;
  y = 1.0 - x;

again:
  z = y - z;
  f(z, 1.0);
  if (z == 0.0)
    goto again;
}

has a fld1 instruction when compiled with "-mfpmath=sse -msse2 -msseregparm
-mtune=pentiumpro -O2".

This instruction is caused by a reload into a FLOAT_REGS register, and moving
the value to a SSE register needs secondary memory.
Comment 1 Paolo Bonzini 2005-07-13 10:07:45 UTC
Vladimir, I believe your rematerialization pass would help a lot in this case
and in other SSE pessimizations.
Comment 2 Andrew Pinski 2005-07-13 11:30:14 UTC

*** This bug has been marked as a duplicate of 19653 ***