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

            Bug ID: 70465
           Summary: Poor code for x87 asm
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: law at redhat dot com
  Target Milestone: ---

Compile with -O2 -fomit-frame-pointer -m32:

 double
 atan2 (double y, double x)
 {
   double res = 0.0;
   asm ("fpatan"
        : "=t" (res) : "u" (y), "0" (x) : "st(1)");
   return res;
 }

There's an unnecessary fxch insn.  According to Jakub, it started somewhere
between r139525 and r139600.  ie, gcc-4.3 got good code, gcc-4.4 has the
unwanted fxch

I briefly looked at the dumps, things seemed OK coming out of the register
allocator, but then reg-stack mucks things up.

Reply via email to