Take the following example:
double d;
float f;
void g(void)
{
  d = 1.0;
  f = 1.0f;
}
----
Currently we get:
_g:
        lis r9,ha16(LC1)
        lis r2,ha16(_d)
        lfs f13,lo16(LC1)(r9)
        lfs f0,lo16(LC1)(r9)
        lis r9,ha16(_f)
        stfs f13,lo16(_f)(r9)
        stfd f0,lo16(_d)(r2)
        blr
--

We should get instead:
_g:
        lis r9,ha16(LC1)
        lis r2,ha16(_d)
        lfs f13,lo16(LC1)(r9)
        lis r9,ha16(_f)
        stfs f13,lo16(_f)(r9)
        stfd f13,lo16(_d)(r2)
        blr

Only one lfs.


-- 
           Summary: Extra load for some FP code
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
GCC target triplet: powerpc-*-*


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

Reply via email to