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 <hjl.tools@gmail.com>
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;
--- /dev/null
+/* { 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;
+}