This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Bug in loop optimize (TREE stage)
- To: gcc at gcc dot gnu dot org
- Subject: Bug in loop optimize (TREE stage)
- From: Denis Chertykov <denisc at overta dot ru>
- Date: Tue, 26 Dec 2000 23:05:31 +0300
"Alexander Popov" <sasho@vip.orbitel.bg> have founded a bug in generic
GCC code.
I have tried avr and x86 ports.
The XXX.rtl file already have a bug.
volatile unsigned char *p;
volatile unsigned char i;
int main(void) {
do {
i++;
} while(p++<(unsigned char *)0xffffffff);
/* if 0xffffffff change to 0xfffffffe then no bug */
return 0;
}
Latest CVS GCC (i586-linux-gcc) generates:
.file "stdin"
.version "01.01"
gcc2_compiled.:
.text
.align 16
.globl main
.type main,@function
main:
movb i, %al
pushl %ebp
incl %eax
movl %esp, %ebp
incl p
movb %al, i
xorl %eax, %eax
popl %ebp
ret
.Lfe1:
.size main,.Lfe1-main
.comm p,4,4
.comm i,1,1
.ident "GCC: (GNU) 2.97 20001226 (experimental)"
Denis.