From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B9C8C3858D28; Thu, 29 Sep 2022 10:52:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B9C8C3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664448723; bh=nJJlun5tbM6DEk3InbTiIdrpFCX9J8pbmTQP6hxPK3A=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uI5WIVtd4hUWZpH9/mgmNdz/S0ZVg9y3R29lEpZz7YN5ABuAz1TsczUF9DJeN1WV3 Nr6zK40gBNm6RyddYsEIHmqok4wAUu/OZAFEiLJMQJ9ENQOBJ3E0qhDeLFkAUJQBiv 8DLBJ5cd4tmHN4bd1o8yqbc3X7C+NNBoqWshMi2g= From: "kloczko.tomasz at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/107078] LTO is causing that firebird build is core dumping Date: Thu, 29 Sep 2022 10:52:03 +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: kloczko.tomasz at gmail dot com 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 #5 from Tomasz K=C5=82oczko -= -- 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."=