@@ -1,3 +1,10 @@
+2011-01-20 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.
+
2011-01-19 H.J. Lu <hongjiu.lu@intel.com>
PR target/47369
@@ -13269,9 +13269,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;
}
@@ -1,3 +1,9 @@
+2011-01-20 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/47372
+ * gcc.target/i386/pr47372-1.c: New.
+ * gcc.target/i386/pr47372-2.c: Likewise.
+
2011-01-19 H.J. Lu <hongjiu.lu@intel.com>
PR target/47369
new file mode 100644
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O2 -fPIC -g" } */
+
+typedef struct FILE FILE;
+int _fwalk(int (*)(FILE *));
+int __sflush(FILE *);
+int
+fflush(FILE *fp)
+{
+ return (_fwalk(__sflush));
+}
new file mode 100644
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O2 -fPIC -g" } */
+
+typedef unsigned short ush;
+typedef ush Pos;
+extern ush prev[];
+void fill_window( unsigned more, unsigned m)
+{
+ unsigned n;
+ for (n = 0; n < (unsigned)(1<<15); n++) {
+ (prev+0x8000)[n] = (Pos)(m >= 0x8000 ? m-0x8000 : 0);
+ }
+ for (n = 0; n < 0x8000; n++) {
+ prev[n] = (Pos)(m >= 0x8000 ? m-0x8000 : 0);
+ }
+}