From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 057A1385802E; Sat, 10 Apr 2021 01:36:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 057A1385802E From: "alex.miller at gmx dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/100010] New: ICE in lto_output_node, at lto-cgraph.c:447 (-fdevirtualize-at-ltrans) Date: Sat, 10 Apr 2021 01:36:42 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 10.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: alex.miller at gmx dot de X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Apr 2021 01:36:43 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100010 Bug ID: 100010 Summary: ICE in lto_output_node, at lto-cgraph.c:447 (-fdevirtualize-at-ltrans) Product: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: alex.miller at gmx dot de CC: marxin at gcc dot gnu.org Target Milestone: --- Building lcdf-typetools-2.108 fails with an ICE while linking the mmafm tool (with gcc-10 using the flags "-O3 -flto -fdevirtualize-at-ltrans"). Here's a reduced sample that reproduces the issue (even with -O2): --- struct String { String(char); ~String(); }; struct ErrorHandler { virtual String decorate(const String &); }; String ErrorHandler::decorate(const String &str) { decorate(str); return 0; } struct LandmarkErrorHandler : ErrorHandler { String _landmark; LandmarkErrorHandler(); String decorate(const String &); }; String LandmarkErrorHandler::decorate(const String &) { return ErrorHandler::decorate(0); } struct Charstring { virtual ~Charstring(); virtual void process() =3D 0; } *interpret_cs; Charstring::~Charstring() {} struct : Charstring { void process() {} } _cdv; int main() { LandmarkErrorHandler(); interpret_cs->process(); } --- $ g++ -O2 -flto -fdevirtualize-at-ltrans a.cc during IPA pass: static-var lto1: internal compiler error: in lto_output_node, at lto-cgraph.c:447 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. lto-wrapper: fatal error: g++ returned 1 exit status compilation terminated. /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin= /ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status Reducing the sources seems a bit brittle, like often with LTO: * Combining all sources in a single file changed the error message to "lto1: internal compiler error: Segmentation fault", but minimizing made the error location reappear. The result is very similar to a multi-file reduction. * Reduced sample fails with -O2, full sources need -O3. * With g++-9.3.0 the reduced sample doesn't trigger the ICE, but the origin= al sources do (at lto-cgraph.c:453). Let me know if you need another sample.=