expr.c (emit_block_move): Don't move anything if size is const 0.
authorJakub Jelinek <jakub@redhat.com>
Wed, 16 Jul 2003 11:07:54 +0000 (13:07 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 16 Jul 2003 11:07:54 +0000 (13:07 +0200)
* expr.c (emit_block_move): Don't move anything if size is const 0.
(clear_storage): Test against const0_rtx instead of comparing INTVAL
against 0.

From-SVN: r69441

gcc/ChangeLog
gcc/expr.c

index 40f58fd8f82a5f7f2920e1451dad73e987dfd686..0e76adbcc02e6b22277dc483fa5534c65e99814a 100644 (file)
@@ -1,3 +1,9 @@
+2003-07-15  Jakub Jelinek  <jakub@redhat.com>
+
+       * expr.c (emit_block_move): Don't move anything if size is const 0.
+       (clear_storage): Test against const0_rtx instead of comparing INTVAL
+       against 0.
+
 2003-07-15  David S. Miller  <davem@redhat.com>
 
        * config/sparc/sparc.c (sparc_nonflat_function_epilogue): Only
index a7f3a1cc8a952b5395ea8a8df3cb1f68948d639d..5dc424d0c61d02e5c5c7a23102392d65766a858a 100644 (file)
@@ -1766,6 +1766,9 @@ emit_block_move (rtx x, rtx y, rtx size, enum block_op_methods method)
      can be incorrect is coming from __builtin_memcpy.  */
   if (GET_CODE (size) == CONST_INT)
     {
+      if (INTVAL (size) == 0)
+       return 0;
+
       x = shallow_copy_rtx (x);
       y = shallow_copy_rtx (y);
       set_mem_size (x, size);
@@ -2975,7 +2978,7 @@ clear_storage (rtx object, rtx size)
       object = protect_from_queue (object, 1);
       size = protect_from_queue (size, 0);
 
-      if (GET_CODE (size) == CONST_INT && INTVAL (size) == 0)
+      if (size == const0_rtx)
        ;
       else if (GET_CODE (size) == CONST_INT
          && CLEAR_BY_PIECES_P (INTVAL (size), align))