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]
Other format: [Raw text]

[Bug optimization/11198] [3.3 regression] -O2 -frename-registers generates wrong code


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11198



------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-04 02:23 -------
Good asm:
	pushl	%ebp
	movl	%esp, %ebp
	subl	$56, %esp
	movl	$0, -16(%ebp)
	movl	8(%ebp), %eax
	movl	12(%ebp), %edx
	movl	$0, -52(%ebp)
	movl	(%eax), %ecx
	movl	%eax, -24(%ebp)
	movl	-32(%ebp), %eax
	movl	%ecx, -20(%ebp)
	movl	$0, -32(%ebp)
	movl	%eax, -12(%ebp)
	movl	(%edx), %eax
	movl	%ecx, -40(%ebp)
	movl	%edx, -40(%ebp)
	movl	%eax, -36(%ebp)
	movl	%eax, -56(%ebp)
	movl	-48(%ebp), %eax
	movl	%eax, -28(%ebp)
	xorl	%eax, %eax
	cmpl	(%ecx), %eax; dies here in bad, ecx = -40(%ebp)

Bad:

	pushl	%ebp
	movl	%esp, %ebp
	subl	$56, %esp
	movl	$0, -16(%ebp)
	movl	8(%ebp), %eax
	movl	12(%ebp), %edx
	movl	$0, -52(%ebp)
	movl	(%eax), %ecx
	movl	%eax, -24(%ebp)
	movl	-32(%ebp), %eax
	movl	%edx, -40(%ebp)
	movl	%ecx, -20(%ebp)
	movl	%eax, -12(%ebp)
	movl	(%edx), %eax
	movl	-48(%ebp), %edx
	movl	$0, -32(%ebp)
	movl	%eax, -36(%ebp)
	movl	%edx, -28(%ebp)
	xorl	%edx, %edx
	cmpl	(%ecx), %edx ; dies here, ecx =  -20(%ebp), not the -40(%ebp) where the good 
one is.


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