summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/tree-ssa-propagate.c
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2013-12-18 19:07:29 +0000
committerpfg <pfg@FreeBSD.org>2013-12-18 19:07:29 +0000
commit6f93e9ad10bb17a8b07e0cab16df0097d5ba6090 (patch)
tree234e9f04b601b7b9c9ff48f56f79bcd379485350 /contrib/gcc/tree-ssa-propagate.c
parenta70f2adf579c967cdf8017632ea2266fe2e9eb4a (diff)
downloadFreeBSD-src-6f93e9ad10bb17a8b07e0cab16df0097d5ba6090.zip
FreeBSD-src-6f93e9ad10bb17a8b07e0cab16df0097d5ba6090.tar.gz
MFC r258428, r258445
gcc: another round of merges from the gcc pre-43 branch. Bring The following revisions from the gcc43 branch[1]: 118360, 118361, 118363, 118576, 119820, 123906, 125246, and 125721. They all have in common that the were merged long ago into Apple's gcc and should help improve the general quality of the compiler and make it easier to bring new features from Apple's gcc42. For details please review the additions to the files: gcc/ChangeLog.gcc43 gcc/cp/ChangeLog.gcc43 (new, adds previous revisions) Fix crosscompilation (r258445 by andreast) Reference: [1] http://gcc.gnu.org/viewcvs/gcc/trunk/?pathrev=126700 Obtained from: gcc pre4.3 (GPLv2) branch MFC after: 3 weeks
Diffstat (limited to 'contrib/gcc/tree-ssa-propagate.c')
-rw-r--r--contrib/gcc/tree-ssa-propagate.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/contrib/gcc/tree-ssa-propagate.c b/contrib/gcc/tree-ssa-propagate.c
index e085911..1a8a614 100644
--- a/contrib/gcc/tree-ssa-propagate.c
+++ b/contrib/gcc/tree-ssa-propagate.c
@@ -1,5 +1,5 @@
/* Generic SSA value propagation engine.
- Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Contributed by Diego Novillo <dnovillo@redhat.com>
This file is part of GCC.
@@ -176,6 +176,8 @@ cfg_blocks_empty_p (void)
static void
cfg_blocks_add (basic_block bb)
{
+ bool head = false;
+
gcc_assert (bb != ENTRY_BLOCK_PTR && bb != EXIT_BLOCK_PTR);
gcc_assert (!TEST_BIT (bb_in_list, bb->index));
@@ -198,12 +200,26 @@ cfg_blocks_add (basic_block bb)
cfg_blocks_head = 0;
VEC_safe_grow (basic_block, heap, cfg_blocks, 2 * cfg_blocks_tail);
}
- else
+ /* Minor optimization: we prefer to see blocks with more
+ predecessors later, because there is more of a chance that
+ the incoming edges will be executable. */
+ else if (EDGE_COUNT (bb->preds)
+ >= EDGE_COUNT (VEC_index (basic_block, cfg_blocks,
+ cfg_blocks_head)->preds))
cfg_blocks_tail = ((cfg_blocks_tail + 1)
% VEC_length (basic_block, cfg_blocks));
+ else
+ {
+ if (cfg_blocks_head == 0)
+ cfg_blocks_head = VEC_length (basic_block, cfg_blocks);
+ --cfg_blocks_head;
+ head = true;
+ }
}
- VEC_replace (basic_block, cfg_blocks, cfg_blocks_tail, bb);
+ VEC_replace (basic_block, cfg_blocks,
+ head ? cfg_blocks_head : cfg_blocks_tail,
+ bb);
SET_BIT (bb_in_list, bb->index);
}
OpenPOWER on IntegriCloud