Take the following code:
#include <math.h>

float foo(float f, float x, float y) {
return (fabs(f)*x+y);
}

on PPC, we should be able to produce:
        fabs f1,f1
        fmadds f1,f1,f2,f3
        blr

But right now we produce:
        fabs f1,f1
        fmadd f1,f1,f2,f3
        frsp f1,f1
        blr

This is because we don't remove promotions we should be able to remove.
If we do:
#include <math.h>

float foo(float f, float x, float y) {
return (fabs(f)*x);
}

The promotions are removed.

-- 
           Summary: promotions (from float to double) are not removed when
                    they should be able to
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22326

Reply via email to