expr.c (emit_block_move): Set memory block size as appropriate for the copy.
authorRichard Henderson <rth@redhat.com>
Tue, 17 Sep 2002 06:56:47 +0000 (23:56 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 17 Sep 2002 06:56:47 +0000 (23:56 -0700)
        * expr.c (emit_block_move): Set memory block size as appropriate
        for the copy.

From-SVN: r57233

gcc/ChangeLog
gcc/expr.c

index 8b1d3dea5aaa9a3530eb70046952036e94553c80..ee29a5a3238ef39b3ee622912238fc60166749b1 100644 (file)
@@ -1,3 +1,8 @@
+2002-09-16  Richard Henderson  <rth@redhat.com>
+
+       * expr.c (emit_block_move): Set memory block size as appropriate
+       for the copy.
+
 2002-09-16  Richard Henderson  <rth@redhat.com>
 
        PR fortran/3924
index 5872ab055fb948a42d8c1bd69d66c566f67fadad..4ac7252332f9b376abc60e76e1735cd94689849e 100644 (file)
@@ -1733,6 +1733,16 @@ emit_block_move (x, y, size, method)
   if (size == 0)
     abort ();
 
+  /* Set MEM_SIZE as appropriate for this block copy.  The main place this
+     can be incorrect is coming from __builtin_memcpy.  */
+  if (GET_CODE (size) == CONST_INT)
+    {
+      x = shallow_copy_rtx (x);
+      y = shallow_copy_rtx (y);
+      set_mem_size (x, size);
+      set_mem_size (y, size);
+    }
+
   if (GET_CODE (size) == CONST_INT && MOVE_BY_PIECES_P (INTVAL (size), align))
     move_by_pieces (x, y, INTVAL (size), align);
   else if (emit_block_move_via_movstr (x, y, size, align))