From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 02BD43858D32; Mon, 23 Jan 2023 17:30:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 02BD43858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674495028; bh=5VxjIf7eh6O6awGN9BJ7SeYPq8Gkb8ysJG+HNvZIK20=; h=From:To:Subject:Date:From; b=Iv1ffGzckd613Wu3EUTkMl8CcBlOZ+ionbShftxKrRlxGj65x/EgJXRwVEkbyjGEu f5OzlxnEdBeobfhD7dgDWwrj7WAlish9OsZyTSLjqpXyhxu5vrTByoIrX4p9R40P1m 7zxDU9KnFIoCBLpvHYpWCgyagK3+gkj7Rqo9YP3w= From: "dhekir at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/108500] New: -O -finline-small-functions results in "internal compiler error: Segmentation fault" on a very large program (700k function calls) Date: Mon, 23 Jan 2023 17:30:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dhekir at gmail dot com 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 target_milestone attachments.created 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108500 Bug ID: 108500 Summary: -O -finline-small-functions results in "internal compiler error: Segmentation fault" on a very large program (700k function calls) Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: dhekir at gmail dot com Target Milestone: --- Created attachment 54328 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D54328&action=3Dedit compressed version of a simplified program causing the ICE In the attached preprocessed program (compressed with .tar.gz), running 'gcc -O -finline-small-functions' results in: gcc: internal compiler error: Segmentation fault signal terminated program = cc1 The original program is more interesting than this simplified version. Stil= l, it does have more than 700k function calls in the main function, which is causing the problem. The original command line was simply 'gcc -O2', then I narrowed the options down to -finline-small-functions. I tried several GCC Docker images (running 'gcc -O2' on the attached file),= and I narrowed it down to: - with gcc:10.4 (or older), compilation works without any errors; - with gcc:11.1 (or newer; I tested up to 12.2.0), segmentation fault happe= ns.=