https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107078

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Tomasz Kłoczko from comment #5)
> FWD of the firebird developer from
> https://github.com/FirebirdSQL/firebird/issues/7308#issuecomment-1262043660
> 
> "Firebird (that code left from interbase times) traditionally zeroes
> memory when allocating a lot of internal data structures using function
> like calloc(). When moving from C to C++ it was wrapped into operator
> new of some base class in order to avoid type casts, be able to use
> ctors and a lot of other c++ features. 20 years ago it was fine. Some
> years ago an optimization removing any data initalization in new (data
> returned by it is not initialized according to standard). By itself it
> did not affect the code - our calloc() is placed into separate file,
> it's not inline. But together with cross-file optimization... we get
> what you've seen.
> 
> Certainly correct fix is to move memory initialization into ctor - but
> that was not done yet.
> 
> May be there some more issues with LTO, I did not learn it deeper."

Then almost certainly -fno-lifetime-dse will help.

Reply via email to