From patchwork Sat Jan 17 03:08:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 430089 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8B4061401EB for ; Sat, 17 Jan 2015 14:09:40 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; q=dns; s=default; b=Ao1dbb6ssqSmsZA8qCGqLcyvNgjg10 4tZQD+DeSsFk23gF7FRdMe9NV0ci6omNe2y1LitpjWe4zLIHtl8bgUeM/qrt691G OpnvxA4ENPHAhSwzmDGkD7o8/uQ016CRYDjX9FAWKRzV+cVAeyTfLPSopfuqkh+f sZ8KR1oElUPJY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; s=default; bh=m7bHNkzhTOoBXdhgPtdhfNbP8NI=; b=XJ5Q aDttOWcinV/sAhMJFepvNnH9aRzZg+5DIyATZwXT6r90+AgJ6xcPnfPv2wGASyAZ qjhYXoFMaDFabLm+Gvn3rQb0+H8ogdm1qHZHHdUYBM2d46cf1iKKW4w9uGQcxQLg 9pJbYC+vOYnXWYOBGIBhr6ysp0N8wcZ8UAK+dfg= Received: (qmail 19659 invoked by alias); 17 Jan 2015 03:09:14 -0000 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 Received: (qmail 19489 invoked by uid 89); 17 Jan 2015 03:08:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f174.google.com Received: from mail-pd0-f174.google.com (HELO mail-pd0-f174.google.com) (209.85.192.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 17 Jan 2015 03:08:10 +0000 Received: by mail-pd0-f174.google.com with SMTP id fl12so7931372pdb.5 for ; Fri, 16 Jan 2015 19:08:08 -0800 (PST) X-Received: by 10.68.235.5 with SMTP id ui5mr27346804pbc.152.1421464088691; Fri, 16 Jan 2015 19:08:08 -0800 (PST) Received: from bubble.grove.modra.org (CPE-58-160-155-134.oycza5.sa.bigpond.net.au. [58.160.155.134]) by mx.google.com with ESMTPSA id pm2sm5255559pbb.81.2015.01.16.19.08.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Jan 2015 19:08:07 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 81E24EA384F; Sat, 17 Jan 2015 13:38:03 +1030 (ACDT) Date: Sat, 17 Jan 2015 13:38:03 +1030 From: Alan Modra To: Jeff Law , gcc-patches@gcc.gnu.org Subject: Re: RTL cprop vs. fixed hard regs Message-ID: <20150117030803.GZ23768@bubble.grove.modra.org> Mail-Followup-To: Jeff Law , gcc-patches@gcc.gnu.org References: <20150116094227.GV23768@bubble.grove.modra.org> <54B93DC4.1020804@redhat.com> <20150117004657.GX23768@bubble.grove.modra.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20150117004657.GX23768@bubble.grove.modra.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes On Sat, Jan 17, 2015 at 11:16:57AM +1030, Alan Modra wrote: > On Fri, Jan 16, 2015 at 09:35:16AM -0700, Jeff Law wrote: > > On 01/16/15 02:42, Alan Modra wrote: > > > * cprop.c (do_local_cprop): Disallow replacement of fixed > > > hard registers. > > OK. Extra credit for a testcase, ppc specific is obviously OK. > > Thanks. Committed revision 219786. I'll see if I can come up with a > reasonable testcase. And now reverted due to Segher's objection. Here's the testcase FWIW. Index: gcc/testsuite/gcc.target/powerpc/cprophard.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/cprophard.c (revision 0) +++ gcc/testsuite/gcc.target/powerpc/cprophard.c (working copy) @@ -0,0 +1,13 @@ +/* { dg-do compile { target { powerpc64*-*-* && lp64 } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ +/* { dg-options "-O2" } */ +/* { dg-final { scan-assembler "ld 2,(24|40)\\(1\\)" } } */ + +/* From a linux kernel mis-compile of net/core/skbuff.c. */ +register unsigned long current_r1 asm ("r1"); + +void f (unsigned int n, void (*fun) (unsigned long)) +{ + while (n--) + (*fun) (current_r1 & -0x1000); +}