This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/18612] Loop optimiser generates incorrect code.
- From: "gccbug at sarek dot cc" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Dec 2004 18:29:35 -0000
- Subject: [Bug rtl-optimization/18612] Loop optimiser generates incorrect code.
- References: <20041122191154.18612.gccbug@sarek.cc>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From gccbug at sarek dot cc 2004-12-13 18:29 -------
I'm sorry I forget to include "-fno-inline" as a compiler option I'm using. When
I compile without "-fno-inline" I do get the same code as you posted here.
This is the code produced using this option:
link.w %a6,#0
move.l %d2,-(%sp)
clr.b %d2
lea Array,%a0
tst.b (%a0)
jbne .L18
.align 2
.L7:
addq.b #1,%d2
cmp.b #5,%d2
jbls .L7
jbra .L16
.align 2
.L18:
jbsr _Z5func2v
addq.b #1,%d2
cmp.b #5,%d2
jbhi .L16
jbsr _Z5func2v
addq.b #1,%d2
cmp.b #5,%d2
jbls .L18
.L16:
move.l -4(%a6),%d2
unlk %a6
rts
John.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18612