aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSteven Bosscher <steven@gcc.gnu.org>2012-08-08 17:39:46 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2012-08-08 17:39:46 +0000
commit07c5a154bb3d23948235bd9481fecca779b1f62d (patch)
treeb760397677133adc286f0671661422a803af861f /gcc
parenta471762f68f0315df2d3c772596c45f38f45fb7c (diff)
downloadgcc-07c5a154bb3d23948235bd9481fecca779b1f62d.zip
gcc-07c5a154bb3d23948235bd9481fecca779b1f62d.tar.gz
gcc-07c5a154bb3d23948235bd9481fecca779b1f62d.tar.bz2
re PR middle-end/54146 (Very slow compile with attribute((flatten)))
PR middle-end/54146 * gimpify.c (gimplify_body): Only verify_gimple_in_seq with checking enabled. * tree-ssa-loop-manip.c (add_exit_phis_var): Assert that var is a gimple_reg if checking is enabled. (find_uses_to_rename_stmt): Only look at non-virtual USE operands. * tree-into-ssa (compute_global_livein): Change the worklist type from an array to a VEC. From-SVN: r190235
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/gimplify.c2
-rw-r--r--gcc/tree-into-ssa.c25
-rw-r--r--gcc/tree-ssa-loop-manip.c8
4 files changed, 30 insertions, 18 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 60f75a3..4bd66d6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2012-08-08 Steven Bosscher <steven@gcc.gnu.org>
+
+ PR middle-end/54146
+ * gimpify.c (gimplify_body): Only verify_gimple_in_seq with
+ checking enabled.
+ * tree-ssa-loop-manip.c (add_exit_phis_var): Assert that var is
+ a gimple_reg if checking is enabled.
+ (find_uses_to_rename_stmt): Only look at non-virtual USE operands.
+ * tree-into-ssa (compute_global_livein): Change the worklist
+ type from an array to a VEC.
+
2012-08-08 Richard Guenther <rguenther@suse.de>
* tree-ssa-operands.h (virtual_operand_p): Declare.
@@ -36,7 +47,7 @@
* combine.c (gen_lowpart_for_combine): Don't return identity
for CONST or symbolic reference.
-2012-08-08 Michael Zolotukhin <michael.v.zolotukhin@intel.com>
+2012-08-08 Michael Zolotukhin <michael.v.zolotukhin@intel.com>
* common/config/i386/i386-common.c (OPTION_MASK_ISA_ADX_SET): New.
(OPTION_MASK_ISA_ADX_UNSET): Likewise.
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index c704010..03f7c9e 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -8200,8 +8200,10 @@ gimplify_body (tree fndecl, bool do_parms)
pop_gimplify_context (outer_bind);
gcc_assert (gimplify_ctxp == NULL);
+#ifdef ENABLE_CHECKING
if (!seen_error ())
verify_gimple_in_seq (gimple_bind_body (outer_bind));
+#endif
timevar_pop (TV_TREE_GIMPLIFY);
input_location = saved_location;
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index eb1ef6c..52f0bdc 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -408,26 +408,28 @@ set_current_def (tree var, tree def)
for LIVEIN). */
void
-compute_global_livein (bitmap livein ATTRIBUTE_UNUSED, bitmap def_blocks ATTRIBUTE_UNUSED)
+compute_global_livein (bitmap livein, bitmap def_blocks)
{
- basic_block bb, *worklist, *tos;
unsigned i;
bitmap_iterator bi;
+ VEC (basic_block, heap) *worklist;
- tos = worklist
- = (basic_block *) xmalloc (sizeof (basic_block) * (last_basic_block + 1));
+ /* Normally the work list size is bounded by the number of basic
+ blocks in the largest loop. We don't know this number, but we
+ can be fairly sure that it will be relatively small. */
+ worklist = VEC_alloc (basic_block, heap, MAX (8, n_basic_blocks / 128));
EXECUTE_IF_SET_IN_BITMAP (livein, 0, i, bi)
- *tos++ = BASIC_BLOCK (i);
+ VEC_safe_push (basic_block, heap, worklist, BASIC_BLOCK (i));
/* Iterate until the worklist is empty. */
- while (tos != worklist)
+ while (! VEC_empty (basic_block, worklist))
{
edge e;
edge_iterator ei;
/* Pull a block off the worklist. */
- bb = *--tos;
+ basic_block bb = VEC_pop (basic_block, worklist);
/* For each predecessor block. */
FOR_EACH_EDGE (e, ei, bb->preds)
@@ -437,16 +439,15 @@ compute_global_livein (bitmap livein ATTRIBUTE_UNUSED, bitmap def_blocks ATTRIBU
/* None of this is necessary for the entry block. */
if (pred != ENTRY_BLOCK_PTR
- && ! bitmap_bit_p (livein, pred_index)
- && ! bitmap_bit_p (def_blocks, pred_index))
+ && ! bitmap_bit_p (def_blocks, pred_index)
+ && bitmap_set_bit (livein, pred_index))
{
- *tos++ = pred;
- bitmap_set_bit (livein, pred_index);
+ VEC_safe_push (basic_block, heap, worklist, pred);
}
}
}
- free (worklist);
+ VEC_free (basic_block, heap, worklist);
}
diff --git a/gcc/tree-ssa-loop-manip.c b/gcc/tree-ssa-loop-manip.c
index 0ddc56f..19a8eca 100644
--- a/gcc/tree-ssa-loop-manip.c
+++ b/gcc/tree-ssa-loop-manip.c
@@ -160,10 +160,8 @@ add_exit_phis_var (tree var, bitmap livein, bitmap exits)
basic_block def_bb = gimple_bb (SSA_NAME_DEF_STMT (var));
bitmap_iterator bi;
- if (is_gimple_reg (var))
- bitmap_clear_bit (livein, def_bb->index);
- else
- bitmap_set_bit (livein, def_bb->index);
+ gcc_checking_assert (is_gimple_reg (var));
+ bitmap_clear_bit (livein, def_bb->index);
def = BITMAP_ALLOC (NULL);
bitmap_set_bit (def, def_bb->index);
@@ -272,7 +270,7 @@ find_uses_to_rename_stmt (gimple stmt, bitmap *use_blocks, bitmap need_phis)
if (is_gimple_debug (stmt))
return;
- FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_ALL_USES)
+ FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_USE)
find_uses_to_rename_use (bb, var, use_blocks, need_phis);
}