@@ -1,3 +1,9 @@
+2011-03-02 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR rtl-optimization/47958
+ * reload.c (find_reloads): Put symbol reference in memory
+ in ptr_mode.
+
2011-03-01 H.J. Lu <hongjiu.lu@intel.com>
PR target/47744
@@ -3918,7 +3918,18 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
&& mode != VOIDmode)
{
int this_address_reloaded;
- rtx tem = force_const_mem (mode, op);
+ rtx tem;
+
+ /* Symbol reference in the constant pool must be in
+ ptr_mode. */
+ if (subreg != NULL_RTX
+ && plus == NULL_RTX
+ && Pmode != ptr_mode
+ && GET_MODE (subreg) == ptr_mode
+ && GET_CODE (op) == SYMBOL_REF)
+ tem = force_const_mem (ptr_mode, op);
+ else
+ tem = force_const_mem (mode, op);
/* If we stripped a SUBREG or a PLUS above add it back. */
if (plus != NULL_RTX)
@@ -1,3 +1,8 @@
+2011-03-02 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR rtl-optimization/47958
+ * gcc.dg/torture/pr47958-1.c: New.
+
2011-03-01 H.J. Lu <hongjiu.lu@intel.com>
PR target/47744
new file mode 100644
@@ -0,0 +1,13 @@
+/* { dg-do assemble } */
+
+void (*foo[6][6]) (int);
+void bar (hdR)
+ int hdR;
+{ }
+void xxx ()
+{
+ unsigned int i, j;
+ for (i = 0; i < 6; ++i)
+ for (j = 0; j < 6; ++j)
+ foo [i][j] = bar;
+}