aboutsummaryrefslogtreecommitdiff
path: root/gcc/stmt.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2001-01-20 17:47:45 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2001-01-20 12:47:45 -0500
commit2954d7dbf7d309d5b5c8fc2a32dae155936ee264 (patch)
treed266c733475e09758d1260c90b41f1c6bf07614a /gcc/stmt.c
parent1d26ac96cc832057ed835b238ca35dfdb930762f (diff)
downloadgcc-2954d7dbf7d309d5b5c8fc2a32dae155936ee264.zip
gcc-2954d7dbf7d309d5b5c8fc2a32dae155936ee264.tar.gz
gcc-2954d7dbf7d309d5b5c8fc2a32dae155936ee264.tar.bz2
stmt.c (expand_return): Don't return anything if size is zero.
* 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. From-SVN: r39156
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r--gcc/stmt.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 450b0da..2399b6f 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -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)