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 c++/13005] Pointer wrongly adjusted for derived class containing virtual function


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


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