From: Kyrylo Tkachov Date: Thu, 23 Mar 2017 14:55:48 +0000 (+0000) Subject: [ARM] PR target/71436: Restrict *load_multiple pattern till after LRA X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=de2b3f5ca93a5627988f274e5e325d023e01f2a1;p=gcc.git [ARM] PR target/71436: Restrict *load_multiple pattern till after LRA PR target/71436 * config/arm/arm.md (*load_multiple): Add reload_completed to matching condition. * gcc.c-torture/compile/pr71436.c: New test. From-SVN: r246419 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 091d78ab739..98254eb4c80 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-03-23 Kyrylo Tkachov + + PR target/71436 + * config/arm/arm.md (*load_multiple): Add reload_completed to + matching condition. + 2017-03-23 Bill Schmidt Richard Biener diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 8720a7178d3..71cc109e102 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -11832,12 +11832,15 @@ ;; Patterns in ldmstm.md don't cover more than 4 registers. This pattern covers ;; large lists without explicit writeback generated for APCS_FRAME epilogue. +;; The operands are validated through the load_multiple_operation +;; match_parallel predicate rather than through constraints so enable it only +;; after reload. (define_insn "*load_multiple" [(match_parallel 0 "load_multiple_operation" [(set (match_operand:SI 2 "s_register_operand" "=rk") (mem:SI (match_operand:SI 1 "s_register_operand" "rk"))) ])] - "TARGET_32BIT" + "TARGET_32BIT && reload_completed" "* { arm_output_multireg_pop (operands, /*return_pc=*/false, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 257c5ce832a..14b75162038 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-03-23 Kyrylo Tkachov + + PR target/71436 + * gcc.c-torture/compile/pr71436.c: New test. + 2017-03-23 Bill Schmidt Richard Biener diff --git a/gcc/testsuite/gcc.c-torture/compile/pr71436.c b/gcc/testsuite/gcc.c-torture/compile/pr71436.c new file mode 100644 index 00000000000..ab08d5d369c --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr71436.c @@ -0,0 +1,35 @@ +/* PR target/71436. */ + +#pragma pack(1) +struct S0 +{ + volatile int f0; + short f2; +}; + +void foo (struct S0 *); +int a, d; +static struct S0 b[5]; +static struct S0 c; +void fn1 (); +void +main () +{ + { + struct S0 e; + for (; d; fn1 ()) + { + { + a = 3; + for (; a >= 0; a -= 1) + { + { + e = c; + } + b[a] = e; + } + } + } + } + foo (b); +}