From patchwork Tue Aug 3 13:28:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 60736 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 387521007D1 for ; Tue, 3 Aug 2010 23:29:16 +1000 (EST) Received: (qmail 17751 invoked by alias); 3 Aug 2010 13:29:13 -0000 Received: (qmail 17739 invoked by uid 22791); 3 Aug 2010 13:29:12 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 Aug 2010 13:29:02 +0000 Received: (qmail 5845 invoked from network); 3 Aug 2010 13:28:59 -0000 Received: from unknown (HELO qiyaows) (yao@127.0.0.2) by mail.codesourcery.com with ESMTPA; 3 Aug 2010 13:28:59 -0000 Date: Tue, 3 Aug 2010 21:28:53 +0800 From: Yao Qi To: gcc-patches@gcc.gnu.org Cc: Yao Qi Subject: Re: [PATCH, ARM] Fix PR45094 Message-ID: <20100803132852.GA15793@qiyaows> References: <20100801083614.GA2569@qiyaows> <20100801145827.GB2569@qiyaows> <20100802003814.GA19224@caradoc.them.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100802003814.GA19224@caradoc.them.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Sun, Aug 01, 2010 at 08:38:18PM -0400, Daniel Jacobowitz wrote: > On Sun, Aug 01, 2010 at 10:58:29PM +0800, Yao Qi wrote: > > Oops... Correct typo in new patch. > > This suggests there should be an execute test. When possible, those > are better. Revise test case to an 'execute test', rather than a 'compile test'. Bootstrapped and regression tested on arm-unknown-linux-gnueabi. No regression. OK to commit? 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. Index: gcc/testsuite/gcc.target/arm/pr45094.c =================================================================== --- gcc/testsuite/gcc.target/arm/pr45094.c (revision 0) +++ gcc/testsuite/gcc.target/arm/pr45094.c (revision 0) @@ -0,0 +1,24 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp" } */ + +#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; +} Index: gcc/config/arm/arm.c =================================================================== --- gcc/config/arm/arm.c (revision 162792) +++ gcc/config/arm/arm.c (working copy) @@ -12570,13 +12570,13 @@ { 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)