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 fortran/37536] New: a mfcr is produced instead of branches (when it is used in branches later)


When looking into PR 37534, I noticed that in some cases a compare and then a
mfcr and then again a compare happens.  This is the most reduced testcase I
could come up with:
Function f(MaxDev, a, b, Step)
        Integer :: Step, NewX, NewY
        Integer :: MaxDev, a, b
        Do NewX = a-MaxDev, b+MaxDev, Step
enddo
MaxDev = NewX
end
--- CUT --
Currently we produce:
.L2:
        cmpw 7,10,9
        neg 8,0
        subf 10,10,9
        mfcr 11
        rlwinm 11,11,30,1
        divwu 10,10,8
        b .L3
--- CUT ---
This is caused by the following tree level code:
    if (D.692 > 0 ? D.691 < D.690 : D.691 > D.690) goto L.2;

I think the front-end might be better at optimizing this.


-- 
           Summary: a mfcr is produced instead of branches (when it is used
                    in branches later)
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org


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


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