diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 3b02d0c..585b2d5 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -10423,10 +10423,10 @@ }) (define_insn_and_split "*andn3_doubleword_bmi" - [(set (match_operand: 0 "register_operand" "=r") + [(set (match_operand: 0 "register_operand" "=&r,r,r") (and: - (not: (match_operand: 1 "register_operand" "r")) - (match_operand: 2 "nonimmediate_operand" "ro"))) + (not: (match_operand: 1 "register_operand" "r,0,r")) + (match_operand: 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..8c2fbbb --- /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 +main (void) +{ + u8 x; + foo (5, &x); + if (x != 5) + __builtin_abort (); + return 0; +} +/* { dg-final { scan-assembler-not "andn\[ \\t\]+%rdi, %r11, %rdi" } } */