aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2001-05-02 17:08:19 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2001-05-02 13:08:19 -0400
commit2be6a7e9029968f7d19f4761f2b4ec013e32cd64 (patch)
tree1f34a5a35f2cb7fecc65e066a5131d93dfafd005 /gcc/expr.c
parent3e411c3ffd2dae9901cb75fd36678865ab4fa91a (diff)
downloadgcc-2be6a7e9029968f7d19f4761f2b4ec013e32cd64.zip
gcc-2be6a7e9029968f7d19f4761f2b4ec013e32cd64.tar.gz
gcc-2be6a7e9029968f7d19f4761f2b4ec013e32cd64.tar.bz2
expr.c (store_field): Do nothing except elaborate side-effects if zero-bit field.
* expr.c (store_field): Do nothing except elaborate side-effects if zero-bit field. From-SVN: r41763
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 0ef52f5..67cafeb 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -5131,6 +5131,11 @@ store_field (target, bitsize, bitpos, mode, exp, value_mode,
if (TREE_CODE (exp) == ERROR_MARK)
return const0_rtx;
+ /* If we have nothing to store, do nothing unless the expression has
+ side-effects. */
+ if (bitsize == 0)
+ return expand_expr (exp, const0_rtx, VOIDmode, 0);
+
if (bitsize < HOST_BITS_PER_WIDE_INT)
width_mask = ((HOST_WIDE_INT) 1 << bitsize) - 1;