This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/37536] New: a mfcr is produced instead of branches (when it is used in branches later)
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Sep 2008 01:29:52 -0000
- Subject: [Bug fortran/37536] New: a mfcr is produced instead of branches (when it is used in branches later)
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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