public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gcc-patches:master commit in: 16.0.0/gentoo/
Date: Thu, 12 Jun 2025 14:05:24 +0000 (UTC)	[thread overview]
Message-ID: <1749737113.9b85c42b38d3e2964755e00ffb09c04177fafbf0.sam@gentoo> (raw)

commit:     9b85c42b38d3e2964755e00ffb09c04177fafbf0
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 12 14:05:13 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jun 12 14:05:13 2025 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=9b85c42b

16.0.0: drop now-upstream patch

Signed-off-by: Sam James <sam <AT> gentoo.org>

 16.0.0/gentoo/75_all_PR120629.patch | 162 ------------------------------------
 1 file changed, 162 deletions(-)

diff --git a/16.0.0/gentoo/75_all_PR120629.patch b/16.0.0/gentoo/75_all_PR120629.patch
deleted file mode 100644
index 5622107..0000000
--- a/16.0.0/gentoo/75_all_PR120629.patch
+++ /dev/null
@@ -1,162 +0,0 @@
-https://inbox.sourceware.org/gcc-patches/aEp6IPgAzLdU5pmi@tucnak/
-
-From 34ddeb4974ec668ee035735dcf57429c12b079b2 Mon Sep 17 00:00:00 2001
-Message-ID: <34ddeb4974ec668ee035735dcf57429c12b079b2.1749713239.git.sam@gentoo.org>
-From: Jakub Jelinek <jakub@redhat.com>
-Date: Thu, 12 Jun 2025 08:56:32 +0200
-Subject: [PATCH] expand: Fix up edge splitting for GIMPLE_COND expansion if
- there are any PHIs [PR120629]
-
-Hi!
-
-My r16-1398 PR120434 ranger during expansion change broke profiled lto
-bootstrap on x86_64-linux, the following testcase is reduced from that.
-
-The problem is during expand_gimple_cond, if we are unlucky that neither
-of edge_true and edge_false point to the next basic block, the code
-effectively attempts to split the false_edge and make the new bb BB_RTL
-with some extra instructions which just arranges to jump.
-It does it by creating a new bb, redirecting the false_edge and then
-creating a new edge from the new bb to the dest.
-Note, we don't have GIMPLE cfg hooks installed anymore and even if we
-would, the 3 calls aren't the same as one split_edge with transformation
-of the new bb into BB_RTL and adding it some BB_HEAD/BB_END.  If
-false_edge->dest is BB_RTL or doesn't have PHI nodes (which before my
-patch was always the case because), then this works fine, but with
-PHI nodes on false_edge->dest redirect_edge_succ will remove the false_edge
-from dest->preds (unordered remove which moves into its place the last edge
-in the vector) and the new make_edge will then add the new edge as last
-in the vector.  So, unless false_edge is the last edge in the dest->preds
-vector this effectively swaps the last edge in the vector with
-false_edge/its new replacement.
-gimple_split_edge solves this by temporarily clearing phi_nodes on dest
-(not needed when we don't have GIMPLE hooks), then making the new edge
-first and redirecting the old edge (plus restoring phi_nodes on dest).
-That way the redirection replaces the old edge with the new one and
-PHI arguments don't need adjustment.  At the cost of temporarily needing
-one more edge in the vector and so if unlucky reallocation.
-Doing it like that is one of the options (i.e. just move the
-make_single_succ_edge call).  This patch instead keeps doing what it did
-and just swaps two edges again if needed to restore the PHI behavior
-- remember edge_false->dest_idx first if there are PHI nodes in
-edge_false->dest and afterwards if new edge's dest_idx is different from
-the remembered one, swap the new edge with EDGE_PRED (dest, old_dest_idx).
-That way PHI arguments are maintained properly as well.  Without this
-we sometimes just swap PHI arguments.
-
-Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
-
-2025-06-12  Jakub Jelinek  <jakub@redhat.com>
-
-	PR middle-end/120629
-	* cfgexpand.cc (expand_gimple_cond): If dest bb isn't BB_RTL,
-	has any PHI nodes and false_edge->dest_idx before redirection is
-	different from make_single_succ_edge result's dest_idx, swap the
-	latter with the former last pred edge and their dest_idx members.
-
-	* g++.dg/opt/pr120629.C: New test.
----
- gcc/cfgexpand.cc                    | 17 ++++++++-
- gcc/testsuite/g++.dg/opt/pr120629.C | 53 +++++++++++++++++++++++++++++
- 2 files changed, 69 insertions(+), 1 deletion(-)
- create mode 100644 gcc/testsuite/g++.dg/opt/pr120629.C
-
-diff --git a/gcc/cfgexpand.cc b/gcc/cfgexpand.cc
-index 49b0b1404200..ce694add0e38 100644
---- a/gcc/cfgexpand.cc
-+++ b/gcc/cfgexpand.cc
-@@ -3013,6 +3013,9 @@ expand_gimple_cond (basic_block bb, gcond *stmt)
- 
-   new_bb = create_basic_block (NEXT_INSN (last), get_last_insn (), bb);
-   dest = false_edge->dest;
-+  unsigned int dest_idx = 0;
-+  if ((dest->flags & BB_RTL) == 0 && phi_nodes (dest))
-+    dest_idx = false_edge->dest_idx;
-   redirect_edge_succ (false_edge, new_bb);
-   false_edge->flags |= EDGE_FALLTHRU;
-   new_bb->count = false_edge->count ();
-@@ -3021,7 +3024,19 @@ expand_gimple_cond (basic_block bb, gcond *stmt)
-   if (loop->latch == bb
-       && loop->header == dest)
-     loop->latch = new_bb;
--  make_single_succ_edge (new_bb, dest, 0);
-+  edge e = make_single_succ_edge (new_bb, dest, 0);
-+  if ((dest->flags & BB_RTL) == 0
-+      && phi_nodes (dest)
-+      && e->dest_idx != dest_idx)
-+    {
-+      /* If there are any PHI nodes on dest, swap the new succ edge
-+	 with the one moved into false_edge's former position, so that
-+	 PHI arguments don't need adjustment.  */
-+      edge e2 = EDGE_PRED (dest, dest_idx);
-+      std::swap (e->dest_idx, e2->dest_idx);
-+      std::swap (EDGE_PRED (dest, e->dest_idx),
-+		 EDGE_PRED (dest, e2->dest_idx));
-+    }
-   if (BARRIER_P (BB_END (new_bb)))
-     BB_END (new_bb) = PREV_INSN (BB_END (new_bb));
-   update_bb_for_insn (new_bb);
-diff --git a/gcc/testsuite/g++.dg/opt/pr120629.C b/gcc/testsuite/g++.dg/opt/pr120629.C
-new file mode 100644
-index 000000000000..70a9cddcd3f2
---- /dev/null
-+++ b/gcc/testsuite/g++.dg/opt/pr120629.C
-@@ -0,0 +1,53 @@
-+// PR middle-end/120629
-+// { dg-do run }
-+// { dg-options "-O2 -fprofile-generate -fno-exceptions -fno-rtti" }
-+// { dg-require-profiling "-fprofile-generate" }
-+
-+__attribute__((noipa, noreturn, cold)) void
-+foo (const char *, int, const char *)
-+{
-+  __builtin_abort ();
-+}
-+
-+struct S
-+{
-+  __attribute__((noipa)) void bar (void *);
-+  static const int a = 8;
-+  unsigned int b[a + 1];
-+};
-+
-+__attribute__((noipa)) unsigned long
-+baz (void *)
-+{
-+  static int x = 8;
-+  return --x;
-+}
-+
-+__attribute__((noipa)) void
-+S::bar (void *x)
-+{
-+  unsigned int c;
-+  int k = 0;
-+
-+  do
-+    {
-+      ((void) (!(k <= a) ? foo ("foo", 42, __FUNCTION__), 0 : 0));
-+      c = b[k++] = baz (x);
-+    }
-+  while (c);
-+  while (k <= a)
-+    b[k++] = 0;
-+}
-+
-+int
-+main ()
-+{
-+  struct T { S a; unsigned int b; } s = {};
-+  s.b = 0x1234;
-+  s.a.bar (0);
-+  for (int i = 0; i < 9; ++i)
-+    if (s.a.b[i] != (i == 8 ? 0 : 7 - i))
-+      __builtin_abort ();
-+  if (s.b != 0x1234)
-+    __builtin_abort ();
-+}
-
-base-commit: ccfd4163970b1aef12b40f49b826bb49f3fc6f2b
--- 
-2.49.0
-


             reply	other threads:[~2025-06-12 14:05 UTC|newest]

Thread overview: 114+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-12 14:05 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-11-03 21:10 [gentoo-commits] proj/gcc-patches:master commit in: 16.0.0/gentoo/ Sam James
2025-11-03 19:52 Sam James
2025-11-03 14:35 Sam James
2025-11-03 14:33 Sam James
2025-11-03  8:59 Sam James
2025-11-03  8:53 Sam James
2025-11-02  8:32 Sam James
2025-10-27  1:46 Sam James
2025-10-23 15:58 Sam James
2025-10-21  0:33 Sam James
2025-10-19 22:41 Sam James
2025-10-18 18:22 Sam James
2025-10-13  2:49 Sam James
2025-10-09  7:31 Sam James
2025-10-09  2:26 Sam James
2025-10-09  2:26 Sam James
2025-10-05 23:05 Sam James
2025-10-05 22:50 Sam James
2025-10-02 11:05 Sam James
2025-10-02 11:04 Sam James
2025-10-02  4:55 Sam James
2025-10-02  1:18 Sam James
2025-10-02  0:40 Sam James
2025-10-02  0:36 Sam James
2025-10-02  0:30 Sam James
2025-09-17 18:41 Sam James
2025-09-17  3:04 Sam James
2025-09-16 19:23 Sam James
2025-09-14 11:26 Sam James
2025-09-13 13:16 Sam James
2025-09-07 22:42 Sam James
2025-09-06  2:42 Sam James
2025-09-05 12:44 Sam James
2025-09-01  8:04 Sam James
2025-08-31 22:43 Sam James
2025-08-30 14:06 Sam James
2025-08-30  8:05 Sam James
2025-08-30  6:57 Sam James
2025-08-30  0:12 Sam James
2025-08-29 21:26 Sam James
2025-08-29 21:02 Sam James
2025-08-29 20:24 Sam James
2025-08-29 20:18 Sam James
2025-08-29 18:38 Sam James
2025-08-29 12:15 Sam James
2025-08-28 17:57 Sam James
2025-08-28  5:27 Sam James
2025-08-27  4:19 Sam James
2025-08-26 23:42 Sam James
2025-08-26  4:48 Sam James
2025-08-26  0:56 Sam James
2025-08-25  3:55 Sam James
2025-08-24 23:42 Sam James
2025-08-21 16:11 Sam James
2025-08-20 20:45 Sam James
2025-08-20 14:10 Sam James
2025-08-20  1:16 Sam James
2025-08-20  1:10 Sam James
2025-08-19 16:30 Sam James
2025-08-18 23:52 Sam James
2025-08-18 23:08 Sam James
2025-08-17 22:45 Sam James
2025-08-17 21:01 Sam James
2025-08-17 16:30 Sam James
2025-08-17 15:44 Sam James
2025-08-17 15:10 Sam James
2025-08-16 23:06 Sam James
2025-08-05  0:23 Sam James
2025-07-30 22:35 Sam James
2025-07-30  0:44 Sam James
2025-07-30  0:44 Sam James
2025-07-25 18:49 Sam James
2025-07-23 11:22 Sam James
2025-07-22 23:56 Sam James
2025-07-21 14:02 Sam James
2025-07-21  1:12 Sam James
2025-07-14 16:03 Sam James
2025-07-14  4:09 Sam James
2025-07-14  2:55 Sam James
2025-07-14  2:55 Sam James
2025-07-14  2:40 Sam James
2025-07-13 23:11 Sam James
2025-07-13  1:09 Sam James
2025-07-12 15:24 Sam James
2025-07-12 15:23 Sam James
2025-07-10 12:34 Sam James
2025-07-10  1:22 Sam James
2025-07-10  0:50 Sam James
2025-07-07 20:49 Sam James
2025-07-06 22:41 Sam James
2025-07-03  1:29 Sam James
2025-06-30  6:26 Sam James
2025-06-29 23:49 Sam James
2025-06-29  0:29 Sam James
2025-06-19 16:59 Sam James
2025-06-19  0:58 Sam James
2025-06-19  0:58 Sam James
2025-06-18 21:17 Sam James
2025-06-18  9:53 Sam James
2025-06-18  9:06 Sam James
2025-06-13 12:03 Sam James
2025-06-12 20:34 Sam James
2025-06-12  7:27 Sam James
2025-06-12  5:46 Sam James
2025-06-11  5:05 Sam James
2025-06-11  3:19 Sam James
2025-06-01 22:39 Sam James
2025-05-31 18:48 Sam James
2025-05-11 22:52 Sam James
2025-05-10 15:28 Sam James
2025-05-09 23:29 Sam James
2025-05-05 14:39 Sam James
2025-05-05 13:05 Sam James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1749737113.9b85c42b38d3e2964755e00ffb09c04177fafbf0.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox