This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug optimization/14729] New: [tree-ssa] missed semi high abstraction penalty due to casts


Derived from <http://gcc.gnu.org/ml/gcc/2004-03/msg01314.html>.
struct OOf {
        float value;
        OOf() {value = 0.0;}
};
inline OOf operator+(OOf op1, OOf op2)
{
        OOf f;
        f.value = op1.value + op2.value;
        return f;
}
inline OOf operator*(OOf op1, OOf op2)
{
        OOf f;
        f.value = op1.value * op2.value;
        return f;
}
inline OOf operator-(OOf op1, OOf op2)
{
        OOf f;
        f.value = op1.value - op2.value;
        return f;
}
OOf test_func(
        OOf a,
        OOf b,
        OOf c
)
{
        OOf d, e;
        OOf result;
        d = a * b + b * c;
        e = a * c - b * d;
        result = d * e;
        return result;
}

I also have a patch to fix this one too.

-- 
           Summary: [tree-ssa] missed semi high abstraction penalty due to
                    casts
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Keywords: pessimizes-code
          Severity: enhancement
          Priority: P2
         Component: optimization
        AssignedTo: pinskia 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=14729


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]