This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Q: Is this improper asm use or a bug?
- From: fnf at intrinsity dot com (Fred Fish)
- To: aoliva at redhat dot com (Alexandre Oliva)
- Cc: fnf at intrinsity dot com, gcc at gcc dot gnu dot org
- Date: Wed, 11 Jun 2003 16:59:06 -0500 (CDT)
- Subject: Re: Q: Is this improper asm use or a bug?
- Reply-to: fnf at intrinsity dot com (Fred Fish)
> > : "+r" (loops)
> > : "0" (loops));
>
> Use either "=r" and "0", or just "+r". Since input and output are the
That didn't have any effect.
BTW, the problem is reproducible using the system gcc supplied with
RedHat 9.0 and comparing with the output of a recent CVS toolchain.
Note that the "movl $50000, %eax" instruction is missing with the
recent CVS toolchain:
$ gcc -S -O2 b.i
$ mv b.s b.s.old
$ /usr/local/sourceware/bin/i686-pc-linux-gnu-gcc -S -O2 b.i
$ diff -c b.s.old b.s
*** b.s.old 2003-06-11 14:54:22.000000000 -0700
--- b.s 2003-06-11 14:54:29.000000000 -0700
***************
*** 1,20 ****
.file "b.i"
.text
! .p2align 2,,3
.globl func
! .type func,@function
func:
pushl %ebp
movl %esp, %ebp
- movl $50000, %eax
#APP
.set noreorder
1: bnez %eax,1b
subu %eax,1
.set reorder
#NO_APP
! leave
ret
! .Lfe1:
! .size func,.Lfe1-func
! .ident "GCC: (GNU) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)"
--- 1,18 ----
.file "b.i"
.text
! .p2align 4,,15
.globl func
! .type func, @function
func:
pushl %ebp
movl %esp, %ebp
#APP
.set noreorder
1: bnez %eax,1b
subu %eax,1
.set reorder
#NO_APP
! popl %ebp
ret
! .size func, .-func
! .ident "GCC: (GNU) 3.4 20030525 (experimental)"
-Fred