From patchwork Tue Nov 13 17:07:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 198745 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 E67FB2C00B1 for ; Wed, 14 Nov 2012 04:08:01 +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=1353431282; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:In-Reply-To:References:Date: Message-ID:Subject:From:To:Cc:Content-Type:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=sgqm3xvhcKzpEfdDCyFy95EslJU=; b=ucTAsgdkcTXJuOWiXWIQdIzEfop05W+AXHEloazKCoL4f6xf9IftywL31AULoA X4r04tuanKwSVaCSI/63cT56vQHOmK9JhMmnlpkYv3PA+UBkvyp+7UMn5ImnCbFQ 6TEFtDBLn+n7PP3ZOyvm8YCuTGCeTXZFHC22ut9egX8ts= 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:MIME-Version:Received:Received:In-Reply-To:References:Date:Message-ID:Subject:From:To:Cc:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=DrWXsAVRGM5BVI9YwRaZvZFifxvybyvS1OcYqCt367+/A4ZXPQN3V++1jt8THV t7PgF5X15ChyvFhs9haKFGi3bZmxAmDaMhqlDAJLc+bBAAuMH8b5TWKJgmD/QYeF TRvJ+bxEcOP/GJpSCIvJoFplJxdmczLYFKZhF0GA2GBd0=; Received: (qmail 28620 invoked by alias); 13 Nov 2012 17:07:55 -0000 Received: (qmail 28607 invoked by uid 22791); 13 Nov 2012 17:07:54 -0000 X-SWARE-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_AV, TW_VZ, TW_ZJ X-Spam-Check-By: sourceware.org Received: from mail-da0-f47.google.com (HELO mail-da0-f47.google.com) (209.85.210.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Nov 2012 17:07:21 +0000 Received: by mail-da0-f47.google.com with SMTP id s35so3085131dak.20 for ; Tue, 13 Nov 2012 09:07:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.68.203.72 with SMTP id ko8mr28873850pbc.78.1352826440735; Tue, 13 Nov 2012 09:07:20 -0800 (PST) Received: by 10.66.246.232 with HTTP; Tue, 13 Nov 2012 09:07:20 -0800 (PST) In-Reply-To: <1796034.IyD9sFR4nE@polaris> References: <20121106.075813.150568568.kkojima@rr.iij4u.or.jp> <5638451.sS5NhrCmua@polaris> <1796034.IyD9sFR4nE@polaris> Date: Tue, 13 Nov 2012 18:07:20 +0100 Message-ID: Subject: Re: [patch RFA middle-end] Fix PR target/41993 From: Uros Bizjak To: Eric Botcazou Cc: gcc-patches@gcc.gnu.org, Kaz Kojima , Vladimir Yakovlev , Oleg Endo 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 Mon, Nov 12, 2012 at 9:40 AM, Eric Botcazou wrote: >> It looks to me, that we in fact want: >> >> --cut here-- >> Index: mode-switching.c >> =================================================================== >> --- mode-switching.c (revision 193407) >> +++ mode-switching.c (working copy) >> @@ -330,7 +330,7 @@ >> short_block = 1; >> break; >> } >> - if (copy_start >= FIRST_PSEUDO_REGISTER) >> + if (!targetm.calls.function_value_regno_p (copy_start)) >> { >> last_insn = return_copy; >> continue; >> --cut here-- >> >> If we find an unrelated HARD register, we will fail in the same way as >> described in the PR. This was found by post-reload vzeroupper >> insertion pass that tripped on unrelated hard reg assignment. At this >> point, we are interested only in hard registers that are also used for >> function return value. Actually, even in pre-reload pass, there are no >> other assignments to hard registers. > > Fine with me if this passes testing on x86-avx and SH4. Committed to mailine SVN with additional restriction, we only want to scan instructions that are not debug instructions. 2012-11-13 Uros Bizjak PR target/41993 * mode-switching.c (create_pre_exit): Set return_copy to last_insn if copy_start is not a function return regno. Skip debug instructions in instruction scan loop. Bootstrapped and regression tested on SH4 by Kaz and Oleg, on AVX target by Vladimir and by me on x86_64-pc-linux-gnu {,-m32 -} AVX target, configured with "--with-arch=corei7-avx --with-cpu=corei7-avx --enable-languages=all,obj-c++,go" with and without postreload vzeroupper insertion patch. Uros. Index: mode-switching.c =================================================================== --- mode-switching.c (revision 193479) +++ mode-switching.c (working copy) @@ -242,7 +242,8 @@ create_pre_exit (int n_entities, int *entity_map, int copy_start, copy_num; int j; - if (INSN_P (return_copy)) + if (INSN_P (return_copy) + && !DEBUG_INSN_P (return_copy)) { /* When using SJLJ exceptions, the call to the unregister function is inserted between the @@ -330,7 +331,7 @@ create_pre_exit (int n_entities, int *entity_map, short_block = 1; break; } - if (copy_start >= FIRST_PSEUDO_REGISTER) + if (!targetm.calls.function_value_regno_p (copy_start)) { last_insn = return_copy; continue;