This is the mail archive of the gcc@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]

RE: A gcc-cris bug?


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


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