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]

Bug in loop optimize (TREE stage)



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


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