This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch to ignore zero-bit stores
- To: gcc-patches at gcc dot gnu dot org
- Subject: Patch to ignore zero-bit stores
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Date: Wed, 2 May 01 13:12:43 EDT
The later code gets confused, so it's best to just short-circuit it.
Tested on Alphaev6. Also committed to branch.
Wed May 2 13:09:36 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* expr.c (store_field): Do nothing except elaborate side-effects if
zero-bit field.
*** expr.c 2001/05/02 02:04:27 1.312
--- expr.c 2001/05/02 16:57:27
*************** store_field (target, bitsize, bitpos, mo
*** 5132,5135 ****
--- 5132,5140 ----
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;