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/11505] Runtime segfault: C++ heap-allocated object loses/changes 'this' address at -O3 when calling virtual inline const function


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

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



------- Additional Comments From dan at bti dot net  2003-07-13 13:16 -------
Subject: Re:  Runtime segfault: C++ heap-allocated
	object loses/changes 'this' address at -O3 when calling virtual inline
	const function

While I stil haven't been able to come up with a simple test case for this,
I did discover another workaround.  Converting all 'virtual inline'
functions in the TTCPConnectionObj class to just 'inline' functions solved
all the problems, even at -O3 optimization.  Converting those functions to
regular 'virtual' functions and removing the code from the header file also
appears to solve the problem.

I did discover some addition bizarre behaviors while testing, such being
able call the object's IsLingerSet() virtual inline function from outside
the object (eg, main()) but not from within another function in the same
object.  But unless I can reproduce it in a simple test case I'm not going
to make any weird claims.

Cheers,

DSC


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