http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49429

--- Comment #11 from Easwaran Raman <eraman at google dot com> 2011-06-20 
18:40:46 UTC ---
(In reply to comment #10)
> With regards to the question in comment #9, you would probably do better 
> asking
> it on the gcc-patches mailing list then in the comment of this bug report 
> since
> more people would see it on the mailing list.

Could you please try out this patch? I don't have the ia-64 host libraries and
have a half-broken cross compiler, but this seems to fix the issue in y.c. 


Index: gcc/expr.c
===================================================================
--- gcc/expr.c    (revision 175081)
+++ gcc/expr.c    (working copy)
@@ -1181,8 +1181,19 @@ emit_block_move_hints (rtx x, rtx y, rtx size, enu
   else if (may_use_call
        && ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (x))
        && ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (y)))
-    retval = emit_block_move_via_libcall (x, y, size,
-                      method == BLOCK_OP_TAILCALL);
+    {
+      /* Since x and y are passed to a libcall, mark the corresponding
+         tree EXPR as addressable.  */
+      tree y_expr = MEM_EXPR (y);
+      tree x_expr = MEM_EXPR (x);
+      if (y_expr)
+        mark_addressable (y_expr);
+      if (x_expr)
+        mark_addressable (x_expr);
+      retval = emit_block_move_via_libcall (x, y, size,
+                        method == BLOCK_OP_TAILCALL);
+    }
+
   else
     emit_block_move_via_loop (x, y, size, align);

Reply via email to