This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: PR target/47372: [x32] internal compiler error: in simplify_subreg, at simplify-rtx.c:5222
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Uros Bizjak <ubizjak at gmail dot com>
- Date: Tue, 26 Jul 2011 12:41:35 -0700
- Subject: PATCH: PR target/47372: [x32] internal compiler error: in simplify_subreg, at simplify-rtx.c:5222
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
Hi,
We should call simplify_gen_subreg for PIC with ptr_mode only if modes
of x and orig_x are different. OK for trunk?
Thanks.
H.J.
---
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 ptr_mode only if modes of
x and orig_x are different.
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 429cd62..9c52aa3 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -12967,9 +12982,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)
+ && GET_MODE (orig_x) != ptr_mode)
{
- x = simplify_gen_subreg (GET_MODE (orig_x), x, Pmode, 0);
+ x = simplify_gen_subreg (GET_MODE (orig_x), x, ptr_mode, 0);
if (x == NULL_RTX)
return orig_x;
}