From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 118885 invoked by alias); 10 Mar 2015 16:14:50 -0000 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 Received: (qmail 118875 invoked by uid 89); 10 Mar 2015 16:14:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_FROM_URIBL_PCCC,KAM_STOCKGEN,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-ie0-f173.google.com Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com) (209.85.223.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 10 Mar 2015 16:14:48 +0000 Received: by iecvj10 with SMTP id vj10so20677510iec.0 for ; Tue, 10 Mar 2015 09:14:46 -0700 (PDT) X-Received: by 10.50.30.130 with SMTP id s2mr58358995igh.11.1426004086038; Tue, 10 Mar 2015 09:14:46 -0700 (PDT) Received: from msticlxl57.ims.intel.com (fmdmzpr02-ext.fm.intel.com. [192.55.55.37]) by mx.google.com with ESMTPSA id w9sm8239191igl.0.2015.03.10.09.14.44 for (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Mar 2015 09:14:45 -0700 (PDT) Date: Tue, 10 Mar 2015 16:14:00 -0000 From: Ilya Enkovich To: gcc-patches@gcc.gnu.org Subject: Re: [PATCH, PR target/65103, 3/3] Change rtx cost for i386 address constants Message-ID: <20150310161437.GG27860@msticlxl57.ims.intel.com> References: <20150310151140.GD27860@msticlxl57.ims.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150310151140.GD27860@msticlxl57.ims.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00577.txt.bz2 On 10 Mar 18:11, Ilya Enkovich wrote: > Hi, > > This patch changes rtx cost for address constants to 0 similar to what we have in address cost hook beacuse we expect them to be propagated into address expression anyway. Bootstrapped and tested on x86_64-unknown-linux-gnu. OK for trunk or stage 1? > > Thanks, > Ilya Updated ChangeLog and test. Thanks, Ilya -- gcc/ 2015-03-10 Ilya Enkovich PR target/65103 * config/i386/i386.c (ix86_rtx_costs): We want to propagate link time constants into adress expressions and therefore set their cost to 0. gcc/testsuite/ 2015-03-10 Ilya Enkovich PR target/65103 * gcc.target/i386/pr65103-3.c: New. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index b3971b8..341a157 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -42039,7 +42039,8 @@ ix86_rtx_costs (rtx x, int code_i, int outer_code_i, int opno, int *total, && !(TARGET_64BIT && (GET_CODE (x) == LABEL_REF || (GET_CODE (x) == SYMBOL_REF - && SYMBOL_REF_LOCAL_P (x))))) + && SYMBOL_REF_LOCAL_P (x)))) + && (TARGET_64BIT || GET_CODE (x) != CONST)) *total = 1; else *total = 0; diff --git a/gcc/testsuite/gcc.target/i386/pr65103-3.c b/gcc/testsuite/gcc.target/i386/pr65103-3.c new file mode 100644 index 0000000..eddf20b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr65103-3.c @@ -0,0 +1,19 @@ +/* { dg-do compile { target ia32 } } */ +/* { dg-require-effective-target pie } */ +/* { dg-options "-O2 -fPIE" } */ +/* { dg-final { scan-assembler-not "GOTOFF," } } */ + +static int *data[100]; + +void test (long a, long b) +{ + do + { + if( a < b ) + { + data[a] = data[b]; + a++; + } + } + while (a <= b); +}