A gcc-cris bug?

Dave Korn dk@artimi.com
Wed Oct 6 18:22:00 GMT 2004


> -----Original Message-----
> From: Graham Stott 
> Sent: 06 October 2004 17:34
> To: Dave Korn; 'Andrew Pinski'
> Cc: 'Richard Guenther'; gcc@gcc.gnu.org; 'Diego Novillo'; 'Tal Agmon'
> Subject: RE: A gcc-cris bug?
> 
> All,
> 
> This goes all the way back to at least 2.95.2
> 
> One problem is the insn "foo = 0" gets moved after the loop 
> end because
> loop optimize determines that it's loop invariant but isn't checking 
> if the insn would modify the loop termination condition.

  I'm sure you're along the right lines here, but notice that in the
original source code I posted, the "foo=0" assignment wasn't moved out of
the loop: it was right there in the middle:

	xorl	%edx, %edx
	movl	_foo, %eax
	cmpl	%eax, %edx
	jge	L9
	.p2align 4,,15
L7:
	xorl	%ecx, %ecx
	movl	%ecx, _foo
	decl	%edx
	jne	L7
	xorl	%eax, %eax
L9:
	movl	%edx, 8(%esp)

  I also tried compiling the testcase with "-O2 -fno-move-all-movables", but
that didn't fix it.

    cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....



More information about the Gcc mailing list