From: Marcus Shawcroft Date: Thu, 3 Oct 2013 10:54:36 +0000 (+0000) Subject: [AArch64] Fix PR58460 X-Git-Tag: releases/gcc-4.9.0~3729 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=24c569251d2a19a0a75af13d7fc85802ad574801;p=thirdparty%2Fgcc.git [AArch64] Fix PR58460 PR58460, the add and sub shifted register instruction forms in AArch64 do not permit the stack register. This patch removes k constraint from the relevant patterns and adds reduced form of the test case. From-SVN: r203157 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 002b761a8b39..fd3903bd678e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2013-10-03 Marcus Shawcroft + + PR target/58460 + * config/aarch64/aarch64.md (*adds_mul_imm_) + (*subs_mul_imm_) + (*add__, *add__si_uxtw,*add_mul_imm_) + (*sub__) + (*sub__si_uxtw,*sub_mul_imm_, *sub_mul_imm_si_uxtw): + Remove k constraint. + 2013-10-03 Ian Bolton * config/aarch64/aarch64.c (aarch64_secondary_reload): Remove legacy diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index 830bbeec08ef..f3e004b6c3e3 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -1365,7 +1365,7 @@ (plus:GPI (mult:GPI (match_operand:GPI 1 "register_operand" "r") (match_operand:QI 2 "aarch64_pwr_2_" "n")) - (match_operand:GPI 3 "register_operand" "rk")) + (match_operand:GPI 3 "register_operand" "r")) (const_int 0))) (set (match_operand:GPI 0 "register_operand" "=r") (plus:GPI (mult:GPI (match_dup 1) (match_dup 2)) @@ -1380,7 +1380,7 @@ (define_insn "*subs_mul_imm_" [(set (reg:CC_NZ CC_REGNUM) (compare:CC_NZ - (minus:GPI (match_operand:GPI 1 "register_operand" "rk") + (minus:GPI (match_operand:GPI 1 "register_operand" "r") (mult:GPI (match_operand:GPI 2 "register_operand" "r") (match_operand:QI 3 "aarch64_pwr_2_" "n"))) @@ -1500,7 +1500,7 @@ ) (define_insn "*add__" - [(set (match_operand:GPI 0 "register_operand" "=rk") + [(set (match_operand:GPI 0 "register_operand" "=r") (plus:GPI (ASHIFT:GPI (match_operand:GPI 1 "register_operand" "r") (match_operand:QI 2 "aarch64_shift_imm_" "n")) (match_operand:GPI 3 "register_operand" "r")))] @@ -1513,7 +1513,7 @@ ;; zero_extend version of above (define_insn "*add__si_uxtw" - [(set (match_operand:DI 0 "register_operand" "=rk") + [(set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI (plus:SI (ASHIFT:SI (match_operand:SI 1 "register_operand" "r") (match_operand:QI 2 "aarch64_shift_imm_si" "n")) @@ -1526,7 +1526,7 @@ ) (define_insn "*add_mul_imm_" - [(set (match_operand:GPI 0 "register_operand" "=rk") + [(set (match_operand:GPI 0 "register_operand" "=r") (plus:GPI (mult:GPI (match_operand:GPI 1 "register_operand" "r") (match_operand:QI 2 "aarch64_pwr_2_" "n")) (match_operand:GPI 3 "register_operand" "r")))] @@ -1873,7 +1873,7 @@ ) (define_insn "*sub__" - [(set (match_operand:GPI 0 "register_operand" "=rk") + [(set (match_operand:GPI 0 "register_operand" "=r") (minus:GPI (match_operand:GPI 3 "register_operand" "r") (ASHIFT:GPI (match_operand:GPI 1 "register_operand" "r") @@ -1887,7 +1887,7 @@ ;; zero_extend version of above (define_insn "*sub__si_uxtw" - [(set (match_operand:DI 0 "register_operand" "=rk") + [(set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI (minus:SI (match_operand:SI 3 "register_operand" "r") (ASHIFT:SI @@ -1901,7 +1901,7 @@ ) (define_insn "*sub_mul_imm_" - [(set (match_operand:GPI 0 "register_operand" "=rk") + [(set (match_operand:GPI 0 "register_operand" "=r") (minus:GPI (match_operand:GPI 3 "register_operand" "r") (mult:GPI (match_operand:GPI 1 "register_operand" "r") @@ -1915,7 +1915,7 @@ ;; zero_extend version of above (define_insn "*sub_mul_imm_si_uxtw" - [(set (match_operand:DI 0 "register_operand" "=rk") + [(set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI (minus:SI (match_operand:SI 3 "register_operand" "r") (mult:SI diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4b7c6ee55d90..44628c5e189b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-10-03 Marcus Shawcroft + + PR target/58460 + * gcc.target/aarch64/pr58460.c: New file. + 2013-10-02 Tobias Burnus PR fortran/58593 diff --git a/gcc/testsuite/gcc.target/aarch64/pr58460.c b/gcc/testsuite/gcc.target/aarch64/pr58460.c new file mode 100644 index 000000000000..a7e149a371c4 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr58460.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-options "-O" } */ +extern unsigned long x1; + +char * +f (char *a, char *b) +{ + return a; +} + +int +g (char *a) +{ + return 2; +} + +void +h (char *p[]) +{ + char n[x1][512]; + char *l = f (p[1], " "); + if (g (p[0])) + n[0][0] = '\0'; + while (l && *l) + { + } +} + +unsigned long x1; + +int +main () +{ + return 0; +}