aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/config/i386/i386.md6
-rw-r--r--gcc/testsuite/gcc.target/i386/pr106273.c27
2 files changed, 30 insertions, 3 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index bf29f44..31637bd 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -10423,10 +10423,10 @@
})
(define_insn_and_split "*andn<dwi>3_doubleword_bmi"
- [(set (match_operand:<DWI> 0 "register_operand" "=r")
+ [(set (match_operand:<DWI> 0 "register_operand" "=&r,r,r")
(and:<DWI>
- (not:<DWI> (match_operand:<DWI> 1 "register_operand" "r"))
- (match_operand:<DWI> 2 "nonimmediate_operand" "ro")))
+ (not:<DWI> (match_operand:<DWI> 1 "register_operand" "r,0,r"))
+ (match_operand:<DWI> 2 "nonimmediate_operand" "ro,ro,0")))
(clobber (reg:CC FLAGS_REG))]
"TARGET_BMI"
"#"
diff --git a/gcc/testsuite/gcc.target/i386/pr106273.c b/gcc/testsuite/gcc.target/i386/pr106273.c
new file mode 100644
index 0000000..0f42213
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr106273.c
@@ -0,0 +1,27 @@
+/* { dg-do compile { target int128 } } */
+/* { dg-options "-Og -march=cascadelake" } */
+typedef unsigned char u8;
+typedef unsigned short u16;
+typedef unsigned long long u64;
+
+u8 g;
+
+void
+foo (__int128 i, u8 *r)
+{
+ u16 a = __builtin_sub_overflow_p (0, i * g, 0);
+ i ^= g & i;
+ u64 s = (i >> 64) + i;
+ *r = ((union { u16 a; u8 b[2]; }) a).b[1] + s;
+}
+
+int
+bar (void)
+{
+ u8 x;
+ foo (5, &x);
+ if (x != 5)
+ __builtin_abort ();
+ return 0;
+}
+/* { dg-final { scan-assembler-not "andn\[ \\t\]+%rdi, %r11, %rdi" } } */