kip a single set of JUMP came from asm goto:
(jump_insn 9 2 111 2 (parallel [
(set (reg:SI 134)
(asm_operands/v:SI ("") ("=r") 0 []
[]
[
(label_ref:DI 10)
] x.c:6))
(clobber (reg:CC 17 flags))
]) "x.c":6:3 -1
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil))
-> 10)
when checking the broadcast source.
gcc/
PR target/125883
* config/i386/i386-features.cc (ix86_broadcast_inner): Skip JUMP
from asm goto.
gcc/testsuite/
PR target/125883
* gcc.target/i386/pr125883.c: New test.
--
H.J.
From 7ad2c6f92435d592be41cb5266b131c735509dff Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <[email protected]>
Date: Fri, 19 Jun 2026 20:05:56 +0800
Subject: [PATCH] x86_cse: Skip JUMP from asm goto
Skip a single set of JUMP came from asm goto:
(jump_insn 9 2 111 2 (parallel [
(set (reg:SI 134)
(asm_operands/v:SI ("") ("=r") 0 []
[]
[
(label_ref:DI 10)
] x.c:6))
(clobber (reg:CC 17 flags))
]) "x.c":6:3 -1
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil))
-> 10)
when checking the broadcast source.
gcc/
PR target/125883
* config/i386/i386-features.cc (ix86_broadcast_inner): Skip JUMP
from asm goto.
gcc/testsuite/
PR target/125883
* gcc.target/i386/pr125883.c: New test.
Signed-off-by: H.J. Lu <[email protected]>
---
gcc/config/i386/i386-features.cc | 5 +++++
gcc/testsuite/gcc.target/i386/pr125883.c | 13 +++++++++++++
2 files changed, 18 insertions(+)
create mode 100644 gcc/testsuite/gcc.target/i386/pr125883.c
diff --git a/gcc/config/i386/i386-features.cc b/gcc/config/i386/i386-features.cc
index 37c68957cba..b0d6e066a43 100644
--- a/gcc/config/i386/i386-features.cc
+++ b/gcc/config/i386/i386-features.cc
@@ -4033,6 +4033,11 @@ ix86_broadcast_inner (rtx op, machine_mode mode,
return nullptr;
rtx_insn *insn = DF_REF_INSN (ref);
+
+ /* Skip JUMP which happens with asm goto. */
+ if (JUMP_P (insn))
+ return nullptr;
+
rtx set = single_set (insn);
if (!set)
return nullptr;
diff --git a/gcc/testsuite/gcc.target/i386/pr125883.c b/gcc/testsuite/gcc.target/i386/pr125883.c
new file mode 100644
index 00000000000..fe44c62e763
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr125883.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=x86-64" } */
+
+int a, b;
+int c[0], d[0];
+void
+foo (void)
+{
+ __asm__ goto("" : "=r"(a) : : : f);
+f:
+ for (; b; b++)
+ c[b] = d[b] = c[b] + a;
+}
--
2.54.0