@@ -1,5 +1,11 @@
2011-01-19 H.J. Lu <hongjiu.lu@intel.com>
+ PR target/47369
+ * config/i386/i386.c (ix86_expand_move): Allow ptr_mode for
+ symbolic operand with PIC.
+
+2011-01-19 H.J. Lu <hongjiu.lu@intel.com>
+
PR target/47364
* builtins.c (expand_builtin_strlen): Convert to Pmode if PAT
isn't in Pmode.
@@ -15323,7 +15323,8 @@ ix86_expand_move (enum machine_mode mode, rtx operands[])
}
if ((flag_pic || MACHOPIC_INDIRECT)
- && mode == Pmode && symbolic_operand (op1, Pmode))
+ && (mode == Pmode || mode == ptr_mode)
+ && symbolic_operand (op1, mode))
{
if (TARGET_MACHO && !TARGET_64BIT)
{
@@ -15364,13 +15365,15 @@ ix86_expand_move (enum machine_mode mode, rtx operands[])
else
{
if (MEM_P (op0))
- op1 = force_reg (Pmode, op1);
- else if (!TARGET_64BIT || !x86_64_movabs_operand (op1, Pmode))
+ op1 = force_reg (mode, op1);
+ else if (!TARGET_64BIT || !x86_64_movabs_operand (op1, mode))
{
rtx reg = can_create_pseudo_p () ? NULL_RTX : op0;
op1 = legitimize_pic_address (op1, reg);
if (op0 == op1)
return;
+ if (GET_MODE (op1) != mode)
+ op1 = convert_to_mode (mode, op1, 1);
}
}
}
@@ -1,5 +1,10 @@
2011-01-19 H.J. Lu <hongjiu.lu@intel.com>
+ PR target/47369
+ * gcc.target/i386/pr47369-1.c: New.
+
+2011-01-19 H.J. Lu <hongjiu.lu@intel.com>
+
PR target/47364
* gcc.target/i386/pr47364-2.c: New.
new file mode 100644
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O2 -fPIC" } */
+
+struct FILE
+{
+ int x;
+};
+extern struct FILE __sF[];
+extern void bar (struct FILE *);
+void dlmalloc_stats() {
+ bar ((&__sF[2]));
+}