diff options
-rw-r--r-- | gcc/config/aarch64/predicates.md | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr113221-1.c | 12 |
2 files changed, 17 insertions, 1 deletions
diff --git a/gcc/config/aarch64/predicates.md b/gcc/config/aarch64/predicates.md index 8a204e4..b895f5d 100644 --- a/gcc/config/aarch64/predicates.md +++ b/gcc/config/aarch64/predicates.md @@ -313,7 +313,11 @@ (define_special_predicate "aarch64_ldp_reg_operand" (and - (match_code "reg,subreg") + (ior + (match_code "reg") + (and + (match_code "subreg") + (match_test "REG_P (SUBREG_REG (op))"))) (match_test "aarch64_ldpstp_operand_mode_p (GET_MODE (op))") (ior (match_test "mode == VOIDmode") diff --git a/gcc/testsuite/gcc.c-torture/compile/pr113221-1.c b/gcc/testsuite/gcc.c-torture/compile/pr113221-1.c new file mode 100644 index 0000000..942fa5e --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr113221-1.c @@ -0,0 +1,12 @@ +/* { dg-options "-fno-move-loop-invariants -funroll-all-loops" } */ +/* PR target/113221 */ +/* This used to ICE after the `load/store pair fusion pass` was added + due to the predicate aarch64_ldp_reg_operand allowing too much. */ + + +void bar(); +void foo(int* b) { + for (;;) + *b++ = (__SIZE_TYPE__)bar; +} + |