From patchwork Wed Jul 7 20:47:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 58171 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 957D9B6EFE for ; Thu, 8 Jul 2010 06:48:32 +1000 (EST) Received: (qmail 28286 invoked by alias); 7 Jul 2010 20:48:30 -0000 Received: (qmail 28276 invoked by uid 22791); 7 Jul 2010 20:48:28 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, SPF_NEUTRAL, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (140.186.70.92) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Jul 2010 20:48:22 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OWbXX-0006B3-Ir for gcc-patches@gcc.gnu.org; Wed, 07 Jul 2010 16:48:20 -0400 Received: from mail-wy0-f175.google.com ([74.125.82.175]:41525) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWbXX-0006Au-Cw for gcc-patches@gcc.gnu.org; Wed, 07 Jul 2010 16:48:19 -0400 Received: by wye20 with SMTP id 20so69205wye.20 for ; Wed, 07 Jul 2010 13:47:18 -0700 (PDT) Received: by 10.227.157.205 with SMTP id c13mr5583078wbx.126.1278535638239; Wed, 07 Jul 2010 13:47:18 -0700 (PDT) Received: from localhost (rsandifo.gotadsl.co.uk [82.133.89.107]) by mx.google.com with ESMTPS id a27sm45475864wbe.12.2010.07.07.13.47.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 07 Jul 2010 13:47:17 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, rdsandiford@googlemail.com Subject: [8/27] Use target structures for init_alias_target References: <87d3v2oqyt.fsf@firetop.home> Date: Wed, 07 Jul 2010 21:47:15 +0100 In-Reply-To: <87d3v2oqyt.fsf@firetop.home> (Richard Sandiford's message of "Sun, 04 Jul 2010 22:51:54 +0100") Message-ID: <874ogbuii4.fsf@firetop.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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 We're now here: /* This depends on stack_pointer_rtx. */ init_fake_stack_mems (); /* Sets static_base_value[HARD_FRAME_POINTER_REGNUM], which is mode-dependent. */ ==> init_alias_target (); /* Depends on HARD_FRAME_POINTER_REGNUM. */ init_reload (); As far as the covering note goes, I think the alias code counts as infrastructure rather than a pass, so the patch puts the data in target_rtl. The data isn't useful to anyone outside alias.c, so the macro definition is kept local to that file. Richard gcc/ * rtl.h (target_rtl): Add x_static_reg_base_value. * alias.c (static_reg_base_value): Redefine as a macro. Index: gcc/rtl.h =================================================================== --- gcc/rtl.h 2010-07-03 23:09:50.000000000 +0100 +++ gcc/rtl.h 2010-07-03 23:10:16.000000000 +0100 @@ -2045,6 +2045,10 @@ struct GTY(()) target_rtl { /* A sample (mem:M stack_pointer_rtx) rtx for each mode M. */ rtx x_top_of_stack[MAX_MACHINE_MODE]; + + /* Static hunks of RTL used by the aliasing code; these are treated + as persistent to avoid unnecessary RTL allocations. */ + rtx x_static_reg_base_value[FIRST_PSEUDO_REGISTER]; }; extern GTY(()) struct target_rtl default_target_rtl; Index: gcc/alias.c =================================================================== --- gcc/alias.c 2010-07-03 23:09:49.000000000 +0100 +++ gcc/alias.c 2010-07-03 23:10:55.000000000 +0100 @@ -211,9 +211,8 @@ static GTY(()) VEC(rtx,gc) *reg_base_val array. */ static GTY((deletable)) VEC(rtx,gc) *old_reg_base_value; -/* Static hunks of RTL used by the aliasing code; these are initialized - once per function to avoid unnecessary RTL allocations. */ -static GTY (()) rtx static_reg_base_value[FIRST_PSEUDO_REGISTER]; +#define static_reg_base_value \ + (this_target_rtl->x_static_reg_base_value) #define REG_BASE_VALUE(X) \ (REGNO (X) < VEC_length (rtx, reg_base_value) \