diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/i386/i386.md | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/pr119428.c | 18 |
2 files changed, 22 insertions, 2 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 2b3cffc..9d1b34e 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -18168,7 +18168,8 @@ [(set (match_dup 4) (match_dup 1)) (set (match_dup 0) (any_rotate:SWI (match_dup 4) - (subreg:QI (match_dup 2) 0)))] + (subreg:QI + (and:SI (match_dup 2) (match_dup 3)) 0)))] "operands[4] = gen_reg_rtx (<MODE>mode);") (define_insn_and_split "*<insn><mode>3_mask_1" @@ -18202,7 +18203,8 @@ == GET_MODE_BITSIZE (<MODE>mode) - 1" [(set (match_dup 4) (match_dup 1)) (set (match_dup 0) - (any_rotate:SWI (match_dup 4) (match_dup 2)))] + (any_rotate:SWI (match_dup 4) + (and:QI (match_dup 2) (match_dup 3))))] "operands[4] = gen_reg_rtx (<MODE>mode);") (define_insn_and_split "*<insn><mode>3_add" diff --git a/gcc/testsuite/gcc.c-torture/execute/pr119428.c b/gcc/testsuite/gcc.c-torture/execute/pr119428.c new file mode 100644 index 0000000..33a93f4 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr119428.c @@ -0,0 +1,18 @@ +/* PR target/119428 */ + +__attribute__((noipa)) void +foo (unsigned int x, unsigned char *y) +{ + y += x >> 3; + *y &= (unsigned char) ~(1 << (x & 0x07)); +} + +int +main () +{ + unsigned char buf[8]; + __builtin_memset (buf, 0xff, 8); + foo (8, buf); + if (buf[1] != 0xfe) + __builtin_abort (); +} |