From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E47123858D28; Thu, 29 Sep 2022 11:00:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E47123858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664449209; bh=3j+mJdf89dxrpi179PCK86P+voaraF3Ad2Ktx2yDxmY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uGS6ToERz+eeMnHhQuAxAqiN7nr00E3I7vlIHXN95/u4NTPs3zwF51NDQnntA8BmV 0vzAlySD+Bb+KAA3XIgMohrgln+blXEJdVx19DUpnXbjalWG81IXQ7BNgvV4Vk58Y6 sA3EfncYWl2P1osFxwkcBfRV9TbtgPxckwXBHiYc= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/107078] LTO is causing that firebird build is core dumping Date: Thu, 29 Sep 2022 11:00:09 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 12.2.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107078 --- Comment #6 from Andrew Pinski --- (In reply to Tomasz K=C5=82oczko from comment #5) > FWD of the firebird developer from > https://github.com/FirebirdSQL/firebird/issues/7308#issuecomment-12620436= 60 >=20 > "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. >=20 > Certainly correct fix is to move memory initialization into ctor - but > that was not done yet. >=20 > May be there some more issues with LTO, I did not learn it deeper." Then almost certainly -fno-lifetime-dse will help.=