From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 735B5384AB75; Fri, 17 May 2024 12:29:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 735B5384AB75 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1715948961; bh=VHYuxFMZBez1NFpIc76u9M0ixN+ngJXqDfUJx1i1Ols=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OUkG9M71E92svMHLDIK7lBAUG0sWQadgHgGie0mWuUeFRj59pod0Wo8f1RZew4o/N ppNCc//TClRnMUXOiryE5d51cgqKAuGK/OLyPkgRubr9byIHJkbZCISK1d2nTm7aM4 xDAkyUVf24BRyLg202TzgNX+sLW/1TM2h2P+LnO8= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114480] [12/13/14/15 Regression] g++: internal compiler error: Segmentation fault signal terminated program cc1plus Date: Fri, 17 May 2024 12:29:19 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.4.0 X-Bugzilla-Keywords: compile-time-hog, memory-hog, ra X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.4 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=3D114480 --- Comment #32 from GCC Commits --- The master branch has been updated by Alexander Monakov : https://gcc.gnu.org/g:4b9e68a6f3b22800a7f12b58ef6b25e3b339bb3c commit r15-628-g4b9e68a6f3b22800a7f12b58ef6b25e3b339bb3c Author: Alexander Monakov Date: Wed May 15 16:23:17 2024 +0300 tree-into-ssa: speed up sorting in prune_unused_phi_nodes [PR114480] In PR 114480 we are hitting a case where tree-into-ssa scales quadratically due to prune_unused_phi_nodes doing O(N log N) work for N basic blocks, for each variable individually. Sorting the 'defs' array is especially costly. It is possible to assist gcc_qsort by laying out dfs_out entries in the reverse order in the 'defs' array, starting from its tail. This is not always a win (in fact it flips most of 7-element qsorts in this testcase from 9 comparisons (best case) to 15 (worst case)), but overall it helps on the testcase and on libstdc++ build. On the testcase we go from 1.28e9 comparator invocations to 1.05e9, on libstdc++ from 2.91e6 to 2.84e6. gcc/ChangeLog: PR c++/114480 * tree-into-ssa.cc (prune_unused_phi_nodes): Add dfs_out entries to the 'defs' array in the reverse order.=