From: Yao Qi Date: Wed, 18 Aug 2010 12:33:43 +0000 (+0000) Subject: re PR target/45094 ([arm] wrong instructions for dword move in some cases) X-Git-Tag: releases/gcc-4.6.0~4954 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8019fcfb557001db4ef756511b6ff49f21392724;p=thirdparty%2Fgcc.git re PR target/45094 ([arm] wrong instructions for dword move in some cases) gcc/ PR target/45094 * config/arm/arm.c (output_move_double): Fix typo generating instructions ('ldr'->'str'). gcc/testsuite/ PR target/45094 * gcc.target/arm/pr45094.c: New test. From-SVN: r163338 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c16adad4bd75..124b3cb38c38 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-08-18 Yao Qi + + PR target/45094 + * config/arm/arm.c (output_move_double): Fix typo generating + instructions ('ldr'->'str'). + 2010-08-18 Maxim Kuvyrkov PR rtl-optimization/42575 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 3dd73e8c0d96..f6148a7309d5 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -12944,13 +12944,13 @@ output_move_double (rtx *operands) { if (GET_CODE (XEXP (operands[0], 0)) == PRE_MODIFY) { - output_asm_insn ("ldr%?\t%0, [%1, %2]!", otherops); - output_asm_insn ("ldr%?\t%H0, [%1, #4]", otherops); + output_asm_insn ("str%?\t%0, [%1, %2]!", otherops); + output_asm_insn ("str%?\t%H0, [%1, #4]", otherops); } else { - output_asm_insn ("ldr%?\t%H0, [%1, #4]", otherops); - output_asm_insn ("ldr%?\t%0, [%1], %2", otherops); + output_asm_insn ("str%?\t%H0, [%1, #4]", otherops); + output_asm_insn ("str%?\t%0, [%1], %2", otherops); } } else if (GET_CODE (XEXP (operands[0], 0)) == PRE_MODIFY) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 793018363ab8..2e2912e79e89 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-08-18 Yao Qi + + PR target/45094 + * gcc.target/arm/pr45094.c: New test. + 2010-08-18 Maxim Kuvyrkov * gcc.target/arm/mla-1.c: Use thumb-friendly architecture. diff --git a/gcc/testsuite/gcc.target/arm/pr45094.c b/gcc/testsuite/gcc.target/arm/pr45094.c new file mode 100644 index 000000000000..05f16d80279f --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/pr45094.c @@ -0,0 +1,27 @@ +/* { dg-do run } */ +/* { dg-require-effective-target arm_neon_hw } */ +/* { dg-options "-O2 -mcpu=cortex-a8" } */ +/* { dg-add-options arm_neon } */ + +#include + +long long buffer[32]; + +void __attribute__((noinline)) f(long long *p, int n) +{ + while (--n >= 0) + { + *p = 1; + p += 32; + } +} + +int main(void) +{ + f(buffer, 1); + + if (!buffer[0]) + abort(); + + return 0; +}