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++/16027] Enabling optimisation causes segfault


------- Additional Comments From s_gccbugzilla at nedprod dot com  2004-06-17 18:46 -------
(In reply to comment #7)
> Even if it were a larger testcase that would help us.

ICC with -cxxlib-gcc exhibits precisely the same behaviour as GCC (works when 
non optimised, segfaults when optimised) - therefore it is not a bug in GCC. 
I'll have to keep looking.

> As to why the compiler is using a different function in one library than 
> in another: the library prohibits you from redefining a global function to 
> be different in two translation units (that includes the source files from 
> which libstdc++ is compiled on the one hand, and your application program 
> on the other hand). If you violate this, you have to expect almost everything. 
> Note in particular, that you can't control whether inlining is used inside 
> libstdc++, since this is compiled when the compiler itself is built, not 
> when you compile your application. 

I've been careful not to override malloc, calloc, realloc or free - my versions 
live within a namespace. And global operator new and delete is guaranteed by the 
C++ standard to be user replaceable which suggests to me it must be always 
treated as a weak symbol by GCC. However perhaps me marking it as inline has 
deleterious effects (if so, perhaps GCC should reject inline operator new?).

Cheers,
Niall


-- 


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


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