This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: A gcc-cris bug?
- From: "Dave Korn" <dk at artimi dot com>
- To: "'Graham Stott'" <graham dot stott at btinternet dot com>,"'Andrew Pinski'" <pinskia at physics dot uc dot edu>
- Cc: "'Richard Guenther'" <richard dot guenther at gmail dot com>,<gcc at gcc dot gnu dot org>,"'Diego Novillo'" <dnovillo at redhat dot com>,"'Tal Agmon'" <tal dot agmon at nsc dot com>
- Date: Wed, 6 Oct 2004 18:19:59 +0100
- Subject: 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....