[patch] tree-cfg.c (create_bb): Remove unnecessary memset.
Kazu Hirata
kazu@cs.umass.edu
Tue Nov 9 19:51:00 GMT 2004
Hi Jeff,
> > * tree-cfg.c (create_bb): Remove unnecessary memset.
> OK assuming you add a suitable comment indicating that alloc_block
> suitably initializes the block it creates.
Here is the final patch that I committed.
Kazu Hirata
2004-11-09 Kazu Hirata <kazu@cs.umass.edu>
* tree-cfg.c (create_bb): Remove unnecessary memset.
Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-cfg.c,v
retrieving revision 2.104
diff -c -d -p -r2.104 tree-cfg.c
*** tree-cfg.c 9 Nov 2004 14:59:48 -0000 2.104
--- tree-cfg.c 9 Nov 2004 19:32:01 -0000
*************** create_bb (void *h, void *e, basic_block
*** 375,383 ****
gcc_assert (!e);
! /* Create and initialize a new basic block. */
bb = alloc_block ();
- memset (bb, 0, sizeof (*bb));
bb->index = last_basic_block;
bb->flags = BB_NEW;
--- 375,384 ----
gcc_assert (!e);
! /* Create and initialize a new basic block. Since alloc_block uses
! ggc_alloc_cleared to allocate a basic block, we do not have to
! clear the newly allocated basic block here. */
bb = alloc_block ();
bb->index = last_basic_block;
bb->flags = BB_NEW;
More information about the Gcc-patches
mailing list