[Bug rtl-optimization/18612] Loop optimiser generates incorrect code.

gccbug at sarek dot cc gcc-bugzilla@gcc.gnu.org
Mon Dec 13 18:29:00 GMT 2004


------- 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



More information about the Gcc-bugs mailing list