This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13005] Pointer wrongly adjusted for derived class containing virtual function
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Nov 2003 17:57:52 -0000
- Subject: [Bug c++/13005] Pointer wrongly adjusted for derived class containing virtual function
- References: <20031111075141.13005.stephenma@telus.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2003-11-11 17:57 -------
Oh, yes, and one more datapoint: without optimization, I get this assembler code:
pushl %ebp
movl %esp, %ebp
movl 8(%ebp), %eax
movl (%eax), %edx
addl $4, %edx
movl 12(%ebp), %eax
movl %eax, 4(%edx)
popl %ebp
ret
That is, the addl is there. On the other hand, _with_ optimization, we get
pushl %ebp
movl %esp, %ebp
movl 8(%ebp), %eax
movl (%eax), %edx
movl 12(%ebp), %eax
movl %eax, 8(%edx)
popl %ebp
ret
The addl is gone, but note that in the first case the result is written
into 4(%edx), while in the second into 8(%edx). My assembler times have
long gone for good, but to me this seems functionally equivalent.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13005