From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3C43915802E for ; Tue, 25 Jun 2024 00:11:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0C9FFE2A85; Tue, 25 Jun 2024 00:11:42 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D972DE2A7E for ; Tue, 25 Jun 2024 00:11:41 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C8D81342F94 for ; Tue, 25 Jun 2024 00:11:40 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 05DF51D32 for ; Tue, 25 Jun 2024 00:11:39 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1719274203.a8b652d02e5d53c11e7a5a0c792bac7e8f5174e9.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/gcc/, sys-devel/gcc/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-devel/gcc/files/gcc-15.0.0_pre20240623-PR115602.patch sys-devel/gcc/gcc-15.0.0_pre20240623-r1.ebuild sys-devel/gcc/gcc-15.0.0_pre20240623.ebuild X-VCS-Directories: sys-devel/gcc/ sys-devel/gcc/files/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: a8b652d02e5d53c11e7a5a0c792bac7e8f5174e9 X-VCS-Branch: master Date: Tue, 25 Jun 2024 00:11:39 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: d891b847-a28b-4e56-b09a-5c69ea1ab2ac X-Archives-Hash: 9e5f5474b0bb2777af4e18da50e564cc commit: a8b652d02e5d53c11e7a5a0c792bac7e8f5174e9 Author: Sam James gentoo org> AuthorDate: Tue Jun 25 00:09:45 2024 +0000 Commit: Sam James gentoo org> CommitDate: Tue Jun 25 00:10:03 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a8b652d0 sys-devel/gcc: backport ICE fix for 15 Bug: https://gcc.gnu.org/PR115602 Signed-off-by: Sam James gentoo.org> .../files/gcc-15.0.0_pre20240623-PR115602.patch | 120 +++++++++++++++++++++ ...623.ebuild => gcc-15.0.0_pre20240623-r1.ebuild} | 1 + 2 files changed, 121 insertions(+) diff --git a/sys-devel/gcc/files/gcc-15.0.0_pre20240623-PR115602.patch b/sys-devel/gcc/files/gcc-15.0.0_pre20240623-PR115602.patch new file mode 100644 index 000000000000..d78c6d964906 --- /dev/null +++ b/sys-devel/gcc/files/gcc-15.0.0_pre20240623-PR115602.patch @@ -0,0 +1,120 @@ +https://gcc.gnu.org/PR115602 +https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=c43c74f6ec795a586388de7abfdd20a0040f6f16 + +From c43c74f6ec795a586388de7abfdd20a0040f6f16 Mon Sep 17 00:00:00 2001 +From: Richard Biener +Date: Mon, 24 Jun 2024 09:52:39 +0200 +Subject: [PATCH] tree-optimization/115602 - SLP CSE results in cycles + +The following prevents SLP CSE to create new cycles which happened +because of a 1:1 permute node being present where its child was then +CSEd to the permute node. Fixed by making a node only available to +CSE to after recursing. + + PR tree-optimization/115602 + * tree-vect-slp.cc (vect_cse_slp_nodes): Delay populating the + bst-map to avoid cycles. + + * gcc.dg/vect/pr115602.c: New testcase. +--- + gcc/testsuite/gcc.dg/vect/pr115602.c | 27 +++++++++++++++++++++++ + gcc/tree-vect-slp.cc | 33 ++++++++++++++++++---------- + 2 files changed, 48 insertions(+), 12 deletions(-) + create mode 100644 gcc/testsuite/gcc.dg/vect/pr115602.c + +diff --git a/gcc/testsuite/gcc.dg/vect/pr115602.c b/gcc/testsuite/gcc.dg/vect/pr115602.c +new file mode 100644 +index 00000000000..9a208d1d950 +--- /dev/null ++++ b/gcc/testsuite/gcc.dg/vect/pr115602.c +@@ -0,0 +1,27 @@ ++/* { dg-do compile } */ ++ ++typedef struct { ++ double x, y; ++} pointf; ++struct { ++ pointf focus; ++ double zoom; ++ pointf devscale; ++ char button; ++ pointf oldpointer; ++} gvevent_motion_job; ++char gvevent_motion_job_4; ++double gvevent_motion_pointer_1, gvevent_motion_pointer_0; ++void gvevent_motion() { ++ double dx = (gvevent_motion_pointer_0 - gvevent_motion_job.oldpointer.x) / ++ gvevent_motion_job.devscale.x, ++ dy = (gvevent_motion_pointer_1 - gvevent_motion_job.oldpointer.y) / ++ gvevent_motion_job.devscale.y; ++ if (dx && dy < .0001) ++ return; ++ switch (gvevent_motion_job_4) ++ case 2: { ++ gvevent_motion_job.focus.x -= dy / gvevent_motion_job.zoom; ++ gvevent_motion_job.focus.y += dx / gvevent_motion_job.zoom; ++ } ++} +diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc +index e84aeabef94..b47b7e8c979 100644 +--- a/gcc/tree-vect-slp.cc ++++ b/gcc/tree-vect-slp.cc +@@ -6079,35 +6079,44 @@ vect_optimize_slp_pass::run () + static void + vect_cse_slp_nodes (scalar_stmts_to_slp_tree_map_t *bst_map, slp_tree& node) + { ++ bool put_p = false; + if (SLP_TREE_DEF_TYPE (node) == vect_internal_def + /* Besides some VEC_PERM_EXPR, two-operator nodes also + lack scalar stmts and thus CSE doesn't work via bst_map. Ideally + we'd have sth that works for all internal and external nodes. */ + && !SLP_TREE_SCALAR_STMTS (node).is_empty ()) + { +- if (slp_tree *leader = bst_map->get (SLP_TREE_SCALAR_STMTS (node))) ++ slp_tree *leader = bst_map->get (SLP_TREE_SCALAR_STMTS (node)); ++ if (leader) + { +- if (*leader != node) +- { +- if (dump_enabled_p ()) +- dump_printf_loc (MSG_NOTE, vect_location, +- "re-using SLP tree %p for %p\n", +- (void *)*leader, (void *)node); +- vect_free_slp_tree (node); +- (*leader)->refcnt += 1; +- node = *leader; +- } ++ /* We've visited this node already. */ ++ if (!*leader || *leader == node) ++ return; ++ ++ if (dump_enabled_p ()) ++ dump_printf_loc (MSG_NOTE, vect_location, ++ "re-using SLP tree %p for %p\n", ++ (void *)*leader, (void *)node); ++ vect_free_slp_tree (node); ++ (*leader)->refcnt += 1; ++ node = *leader; + return; + } + +- bst_map->put (SLP_TREE_SCALAR_STMTS (node).copy (), node); ++ /* Avoid creating a cycle by populating the map only after recursion. */ ++ bst_map->put (SLP_TREE_SCALAR_STMTS (node).copy (), nullptr); + node->refcnt += 1; ++ put_p = true; + /* And recurse. */ + } + + for (slp_tree &child : SLP_TREE_CHILDREN (node)) + if (child) + vect_cse_slp_nodes (bst_map, child); ++ ++ /* Now record the node for CSE in other siblings. */ ++ if (put_p) ++ bst_map->put (SLP_TREE_SCALAR_STMTS (node).copy (), node); + } + + /* Optimize the SLP graph of VINFO. */ +-- +2.43.0 diff --git a/sys-devel/gcc/gcc-15.0.0_pre20240623.ebuild b/sys-devel/gcc/gcc-15.0.0_pre20240623-r1.ebuild similarity index 97% rename from sys-devel/gcc/gcc-15.0.0_pre20240623.ebuild rename to sys-devel/gcc/gcc-15.0.0_pre20240623-r1.ebuild index b2ef3b0ac50b..0bfd8a8fe85d 100644 --- a/sys-devel/gcc/gcc-15.0.0_pre20240623.ebuild +++ b/sys-devel/gcc/gcc-15.0.0_pre20240623-r1.ebuild @@ -49,5 +49,6 @@ src_prepare() { toolchain_src_prepare + eapply "${FILESDIR}"/${P}-PR115602.patch eapply_user }