From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20952 invoked by alias); 19 Aug 2010 19:42:45 -0000 Received: (qmail 20917 invoked by uid 22791); 19 Aug 2010 19:42:43 -0000 X-SWARE-Spam-Status: No, hits=-5.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 19 Aug 2010 19:42:38 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7JJgUss026817 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 19 Aug 2010 15:42:30 -0400 Received: from anchor.twiddle.home (ovpn-113-26.phx2.redhat.com [10.3.113.26]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o7JJgUKE001871; Thu, 19 Aug 2010 15:42:30 -0400 Message-ID: <4C6D8926.4080303@redhat.com> Date: Thu, 19 Aug 2010 19:55:00 -0000 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100720 Fedora/3.1.1-1.fc13 Thunderbird/3.1.1 MIME-Version: 1.0 To: Bernd Schmidt , Andrew Stubbs , gcc-patches@gcc.gnu.org Subject: Re: [PATCH 1/3] SH-2A FDPIC: New pattern: use_initial_val References: <4C6D56F2.3060204@codesourcery.com> <4C6D755E.9030903@redhat.com> <4C6D7831.1080802@codesourcery.com> <4C6D7B19.9080003@redhat.com> <4C6D7E18.9050009@codesourcery.com> <20100819193342.GA26910@caradoc.them.org> In-Reply-To: <20100819193342.GA26910@caradoc.them.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2010-08/txt/msg01503.txt.bz2 On 08/19/2010 12:33 PM, Daniel Jacobowitz wrote: > On Thu, Aug 19, 2010 at 08:55:20PM +0200, Bernd Schmidt wrote: >> For FD-PIC, the incoming PIC reg is loaded into a pseudo with the >> initial values machinery. The problem occurs if during expand we >> already had something that required the PIC register, so the pseudo was >> set up, but all the uses (and hence the initializing insn) were >> optimized away. So there really isn't anywhere to put it anymore in >> this case. > > FWIW, I once tried to make the MIPS pic base into a pseudo, and > encountered this same problem - I eventually gave up, but maybe it can > be done the same way. Yeah, same with Alpha. In the end I left it as a fixed register, and use peep2's to avoid reloading it after calls when it's dead. Indeed, I don't even expose the use of the PIC register before reload is complete; the optimizers are much happier with a bare (symbol_ref "sdata_sym") than they are with an expression that involves the pic register. SH has only 16 registers though, so I can understand the strong desire to retain the register allocation freedom. r~