This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/11198] [3.3 regression] -O2 -frename-registers generates wrong code
- From: "pinskia at physics dot uc dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Jul 2003 02:23:48 -0000
- Subject: [Bug optimization/11198] [3.3 regression] -O2 -frename-registers generates wrong code
- References: <20030615174957.11198.jhr.walter@t-online.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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.