This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/11505] Runtime segfault: C++ heap-allocated object loses/changes 'this' address at -O3 when calling virtual inline const function
- From: "dan at bti dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Jul 2003 13:16:41 -0000
- Subject: [Bug optimization/11505] Runtime segfault: C++ heap-allocated object loses/changes 'this' address at -O3 when calling virtual inline const function
- References: <20030711222234.11505.dan@bti.net>
- 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=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