OSDN Git Service

* stmt.c (expand_return): Don't return anything if size is zero.
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 20 Jan 2001 17:47:45 +0000 (17:47 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 20 Jan 2001 17:47:45 +0000 (17:47 +0000)
Delete redundant assignment to BYTES.
* expr.c (move_block_from_reg): Do nothing if NREGS is zero.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39156 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/expr.c
gcc/stmt.c

index cded5b2..3cff034 100644 (file)
@@ -1,3 +1,9 @@
+Sat Jan 20 12:46:57 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
+
+       * stmt.c (expand_return): Don't return anything if size is zero.
+       Delete redundant assignment to BYTES.
+       * expr.c (move_block_from_reg): Do nothing if NREGS is zero.
+
 2001-01-20  Marek Michalkiewicz  <marekm@linux.org.pl>
 
        * config/avr/avr.h (INIT_TARGET_OPTABS): Remove most of it, was
index a78be1b..848431e 100644 (file)
@@ -1857,6 +1857,9 @@ move_block_from_reg (regno, x, nregs, size)
 #endif
   enum machine_mode mode;
 
+  if (nregs == 0)
+    return;
+
   /* If SIZE is that of a mode no bigger than a word, just use that
      mode's store operation.  */
   if (size <= UNITS_PER_WORD
index 450b0da..2399b6f 100644 (file)
@@ -3016,6 +3016,12 @@ expand_return (retval)
       rtx result_val = expand_expr (retval_rhs, NULL_RTX, VOIDmode, 0);
       enum machine_mode tmpmode, result_reg_mode;
 
+      if (bytes == 0)
+       {
+         expand_null_return ();
+         return;
+       }
+
       /* Structures whose size is not a multiple of a word are aligned
         to the least significant byte (to the right).  On a BYTES_BIG_ENDIAN
         machine, this means we must skip the empty high order bytes when
@@ -3063,15 +3069,12 @@ expand_return (retval)
       /* Find the smallest integer mode large enough to hold the
         entire structure and use that mode instead of BLKmode
         on the USE insn for the return register.   */
-      bytes = int_size_in_bytes (TREE_TYPE (retval_rhs));
       for (tmpmode = GET_CLASS_NARROWEST_MODE (MODE_INT);
           tmpmode != VOIDmode;
           tmpmode = GET_MODE_WIDER_MODE (tmpmode))
-       {
-         /* Have we found a large enough mode?  */
-         if (GET_MODE_SIZE (tmpmode) >= bytes)
-           break;
-       }
+       /* Have we found a large enough mode?  */
+       if (GET_MODE_SIZE (tmpmode) >= bytes)
+         break;
 
       /* No suitable mode found.  */
       if (tmpmode == VOIDmode)