aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2003-10-10 19:21:12 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2003-10-10 15:21:12 -0400
commit7a06d606a6a5d81acae07c94490217c55278476b (patch)
tree7722b6ab3f8762ae29f0ecc9ce017162d94cdd55 /gcc/expr.c
parent892c9f1f53581abe563e6e0183fbc05936d10e95 (diff)
downloadgcc-7a06d606a6a5d81acae07c94490217c55278476b.zip
gcc-7a06d606a6a5d81acae07c94490217c55278476b.tar.gz
gcc-7a06d606a6a5d81acae07c94490217c55278476b.tar.bz2
stor-layout.c (compute_record_mode): Don't force BLKmode if field is zero-length BLKmode.
* stor-layout.c (compute_record_mode): Don't force BLKmode if field is zero-length BLKmode. * expr.c (expand_expr, case COMPONENT_REF): Handle case of BLKmode zero-size references. From-SVN: r72311
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 9c912d0..54bff3f 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -7223,6 +7223,12 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode,
if (ext_mode == BLKmode)
{
+ if (target == 0)
+ target = assign_temp (type, 0, 1, 1);
+
+ if (bitsize == 0)
+ return target;
+
/* In this case, BITPOS must start at a byte boundary and
TARGET, if specified, must be a MEM. */
if (GET_CODE (op0) != MEM
@@ -7230,11 +7236,9 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode,
|| bitpos % BITS_PER_UNIT != 0)
abort ();
- op0 = adjust_address (op0, VOIDmode, bitpos / BITS_PER_UNIT);
- if (target == 0)
- target = assign_temp (type, 0, 1, 1);
-
- emit_block_move (target, op0,
+ emit_block_move (target,
+ adjust_address (op0, VOIDmode,
+ bitpos / BITS_PER_UNIT),
GEN_INT ((bitsize + BITS_PER_UNIT - 1)
/ BITS_PER_UNIT),
(modifier == EXPAND_STACK_PARM