From patchwork Thu Nov 1 08:54:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Endo X-Patchwork-Id: 196095 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 7E7D52C0123 for ; Thu, 1 Nov 2012 19:55:00 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1352364901; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:Mime-Version:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=BPRjkQHYN3XHdUxSQ+2MuHJlpQc=; b=SR74r4rAmhdLL2N JuIONTatgecWZPYBNXQO1x2ybXlvSTmhn8Uf9rAstW37Og6e5WzWXMZGQYcoqayO Gzi3zLsCU11femtSwg6vt0xq/JHRpONeagsMwoDP232EuufrknhEoqRzW/1iQjGT l8cy+tYQxxEz20bkdQsd7MthWuP0= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References:Content-Type:Mime-Version:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=VTOeISDK0V0yr1iH0fUV1JZr58PCxoXvldZg/FVUWiwfJ1vmDvBfqCXC3n1ZFK jGj267b6Gsyd4dpXv0vV2mPNbk2Sva/Wf4OtHO0S8Hf6D7gUANc2DIZpSkVuYm7P uUYL0vtzu8LBXkWkrrdmKfGtSi4i7UQdGUukIs3k2zsLM=; Received: (qmail 7347 invoked by alias); 1 Nov 2012 08:54:56 -0000 Received: (qmail 7334 invoked by uid 22791); 1 Nov 2012 08:54:55 -0000 X-SWARE-Spam-Status: No, hits=-3.9 required=5.0 tests=AWL, BAYES_00, KHOP_THREADED, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_NO, RP_MATCHES_RCVD, UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Received: from mailout08.t-online.de (HELO mailout08.t-online.de) (194.25.134.20) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 01 Nov 2012 08:54:45 +0000 Received: from fwd50.aul.t-online.de (fwd50.aul.t-online.de ) by mailout08.t-online.de with smtp id 1TTqY0-00032e-0C; Thu, 01 Nov 2012 09:54:44 +0100 Received: from [192.168.0.100] (TtyJQOZlrhd4avIUteYkgA44NGfwv1-uf4nqdk4LSqqyVqgGNwuES244-2xbMpAQdl@[93.218.184.95]) by fwd50.t-online.de with esmtp id 1TTqXz-0gnr0K0; Thu, 1 Nov 2012 09:54:43 +0100 Message-ID: <1351760078.8110.8.camel@yam-132-YW-E178-FTW> Subject: Re: Committed: Fix sh regression for target/55160 From: Oleg Endo To: Joern Rennecke Cc: gcc-patches@gcc.gnu.org Date: Thu, 01 Nov 2012 09:54:38 +0100 In-Reply-To: <20121101023134.bi7fc0ci2yo8880s-nzlynne@webmail.spamcop.net> References: <20121101023134.bi7fc0ci2yo8880s-nzlynne@webmail.spamcop.net> Mime-Version: 1.0 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 Thu, 2012-11-01 at 02:31 -0400, Joern Rennecke wrote: > gen_doloop_end_split creates a pattern that sets pc, hence emit_jump_insn > has to be used instead of emit_insn. > > Committed as obvious. I'd like to add a test case for this. Attached patch was tested with make -k check-gcc RUNTESTFLAGS="sh.exp=pr55160.c --target_board=sh-sim \{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}" OK to install? Cheers, Oleg testsuite/ChangeLog: PR target/55160 * gcc.target/sh/pr55160.c: New. Index: gcc/testsuite/gcc.target/sh/pr55160.c =================================================================== --- gcc/testsuite/gcc.target/sh/pr55160.c (revision 0) +++ gcc/testsuite/gcc.target/sh/pr55160.c (revision 0) @@ -0,0 +1,25 @@ +/* Check that the decrement-and-test instruction is generated. */ +/* { dg-do compile { target "sh*-*-*" } } */ +/* { dg-options "-O1" } */ +/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ +/* { dg-final { scan-assembler-times "dt\tr" 2 } } */ + +int +test_00 (int* x, int c) +{ + int s = 0; + int i; + for (i = 0; i < c; ++i) + s += x[i]; + return s; +} + +int +test_01 (int* x, int c) +{ + int s = 0; + int i; + for (i = 0; i < c; ++i) + s += *--x; + return s; +}