aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2011-07-26 21:43:57 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2011-07-26 14:43:57 -0700
commit65ceed36018fcc227a90fee38ee07cd935c53b64 (patch)
treed22fb0f25df573288028ba1bdb10e98cf25069d8
parentb56bc05b9f9a69ab8136243616a31f9b3f2708fc (diff)
downloadgcc-65ceed36018fcc227a90fee38ee07cd935c53b64.zip
gcc-65ceed36018fcc227a90fee38ee07cd935c53b64.tar.gz
gcc-65ceed36018fcc227a90fee38ee07cd935c53b64.tar.bz2
Call simplify_gen_subreg for PIC with mode of x.
2011-07-26 H.J. Lu <hongjiu.lu@intel.com> PR target/47372 * config/i386/i386.c (ix86_delegitimize_address): Call simplify_gen_subreg for PIC with mode of x only if modes of x and orig_x are different. From-SVN: r176812
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/i386/i386.c5
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 08fb665..b93f220 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2011-07-26 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/47372
+ * config/i386/i386.c (ix86_delegitimize_address): Call
+ simplify_gen_subreg for PIC with mode of x only if modes of
+ x and orig_x are different.
+
2011-07-26 Jakub Jelinek <jakub@redhat.com>
* dwarf2out.c (output_macinfo_op): Ensure fd->filename points
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 429cd62..960622a 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -12967,9 +12967,10 @@ ix86_delegitimize_address (rtx x)
|| !MEM_P (orig_x))
return ix86_delegitimize_tls_address (orig_x);
x = XVECEXP (XEXP (x, 0), 0, 0);
- if (GET_MODE (orig_x) != Pmode)
+ if (GET_MODE (orig_x) != GET_MODE (x))
{
- x = simplify_gen_subreg (GET_MODE (orig_x), x, Pmode, 0);
+ x = simplify_gen_subreg (GET_MODE (orig_x), x,
+ GET_MODE (x), 0);
if (x == NULL_RTX)
return orig_x;
}