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

Re: gcc 2.95.2, bug in gcse?


> The current gcc-2_95-branch works OK on powerpc-linux-gnu. Are you sure you
> didn't get confused by the strange testcase? It aborts for correct behaviour
> and segfaults for the bug.

Yes, here is the generated code

	.file	"a.c"
	.version	"01.01"
gcc2_compiled.:
.text
	.align 4
.globl main
	.type	 main,@function
main:
	pushl %ebp
	movl %esp,%ebp
	subl $8,%esp
	xorl %edx,%edx
	movb 0,%al
	.p2align 4,,7
.L6:
	testl %edx,%edx
	je .L4
	testb %al,%al
	je .L6
.L4:
	call abort
.Lfe1:
	.size	 main,.Lfe1-main
	.ident	"GCC: (GNU) 2.95.3 19991030 (prerelease)"

You'll notice the unconditional 
	movb 0,%al

which means 'al = *(char*)0'.

Regards,
Martin

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