re PR target/65103 ([i386] GOTOFF relocation is not propagated into address expression)

gcc/

	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/

	PR target/65103
	* gcc.target/i386/pr65103-3.c: New.

From-SVN: r223119
This commit is contained in:
Ilya Enkovich 2015-05-13 08:29:14 +00:00 committed by Ilya Enkovich
parent f27127cedd
commit 7947dd0bdf
4 changed files with 34 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2015-05-13 Ilya Enkovich <ilya.enkovich@intel.com>
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.
2015-05-13 Jakub Jelinek <jakub@redhat.com>
PR target/66112

View File

@ -42006,7 +42006,9 @@ 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))))
/* Use 0 cost for CONST to improve its propagation. */
&& (TARGET_64BIT || GET_CODE (x) != CONST))
*total = 1;
else
*total = 0;

View File

@ -1,3 +1,8 @@
2015-05-13 Ilya Enkovich <ilya.enkovich@intel.com>
PR target/65103
* gcc.target/i386/pr65103-3.c: New.
2015-05-13 Martin Liska <mliska@suse.cz>
* g++.dg/ipa/pr65557.C: Remove unnecessary dump flag.

View File

@ -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);
}