From: Richard Kenner Date: Wed, 2 May 2001 17:08:19 +0000 (+0000) Subject: expr.c (store_field): Do nothing except elaborate side-effects if zero-bit field. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2be6a7e9029968f7d19f4761f2b4ec013e32cd64;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7dad94b2fdf..8779914283f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Wed May 2 13:09:36 2001 Richard Kenner + + * expr.c (store_field): Do nothing except elaborate side-effects if + zero-bit field. + 2001-05-02 Kaveh R. Ghazi * c-lex.c: NULL_PTR -> NULL. diff --git a/gcc/expr.c b/gcc/expr.c index 0ef52f5d9ce..67cafeb7c9c 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;