From: Zack Weinberg Date: Wed, 25 Aug 2004 07:25:06 +0000 (+0000) Subject: basic-block.h (BB_SET_PARTITION): Clear old value first. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=51a904c9e6cbce9225c8b584eff328e71afb049b;p=gcc.git basic-block.h (BB_SET_PARTITION): Clear old value first. * basic-block.h (BB_SET_PARTITION): Clear old value first. * cfg.c (clear_bb_flags): Don't clear partition setting. From-SVN: r86537 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 979fb11a284..12e36f5b370 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-08-25 Zack Weinberg + + * basic-block.h (BB_SET_PARTITION): Clear old value first. + * cfg.c (clear_bb_flags): Don't clear partition setting. + 2004-08-25 Alan Modra PR target/17052 diff --git a/gcc/basic-block.h b/gcc/basic-block.h index 64dda040443..19ed577fe55 100644 --- a/gcc/basic-block.h +++ b/gcc/basic-block.h @@ -318,7 +318,12 @@ typedef struct reorder_block_def /* Partitions, to be used when partitioning hot and cold basic blocks into separate sections. */ #define BB_PARTITION(bb) ((bb)->flags & (BB_HOT_PARTITION|BB_COLD_PARTITION)) -#define BB_SET_PARTITION(bb, part) ((bb)->flags |= (part)) +#define BB_SET_PARTITION(bb, part) do { \ + basic_block bb_ = (bb); \ + bb_->flags = ((bb_->flags & ~(BB_HOT_PARTITION|BB_COLD_PARTITION)) \ + | (part)); \ +} while (0) + #define BB_COPY_PARTITION(dstbb, srcbb) \ BB_SET_PARTITION (dstbb, BB_PARTITION (srcbb)) diff --git a/gcc/cfg.c b/gcc/cfg.c index d195b10cd4e..003d09e05ff 100644 --- a/gcc/cfg.c +++ b/gcc/cfg.c @@ -462,13 +462,14 @@ redirect_edge_pred (edge e, basic_block new_pred) e->src = new_pred; } +/* Clear all basic block flags, with the exception of partitioning. */ void clear_bb_flags (void) { basic_block bb; FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb) - bb->flags = 0; + bb->flags = BB_PARTITION (bb); } /* Check the consistency of profile information. We can't do that