Commit b0dd8c90 by Richard Biener Committed by Richard Biener

cfgexpand.c (expand_gimple_stmt_1): Use ops.code.

2015-04-23  Richard Biener  <rguenther@suse.de>

	* cfgexpand.c (expand_gimple_stmt_1): Use ops.code.
	* cfgloop.c (verify_loop_structure): Verify the root loop node.
	* except.c (duplicate_eh_regions): Call get_eh_region_from_lp_number_fn
	instead of get_eh_region_from_lp_number.
	* loop-init.c (fix_loop_structure): If we removed a loop, reset
	the SCEV cache.

From-SVN: r222353
parent 905bcb98
2015-04-23 Richard Biener <rguenther@suse.de>
* cfgexpand.c (expand_gimple_stmt_1): Use ops.code.
* cfgloop.c (verify_loop_structure): Verify the root loop node.
* except.c (duplicate_eh_regions): Call get_eh_region_from_lp_number_fn
instead of get_eh_region_from_lp_number.
* loop-init.c (fix_loop_structure): If we removed a loop, reset
the SCEV cache.
2015-04-23 Anton Blanchard <anton@samba.org> 2015-04-23 Anton Blanchard <anton@samba.org>
* config/rs6000/rs6000.c (rs6000_output_function_prologue): No * config/rs6000/rs6000.c (rs6000_output_function_prologue): No
......
...@@ -3413,7 +3413,7 @@ expand_gimple_stmt_1 (gimple stmt) ...@@ -3413,7 +3413,7 @@ expand_gimple_stmt_1 (gimple stmt)
ops.code = gimple_assign_rhs_code (assign_stmt); ops.code = gimple_assign_rhs_code (assign_stmt);
ops.type = TREE_TYPE (lhs); ops.type = TREE_TYPE (lhs);
switch (get_gimple_rhs_class (gimple_expr_code (stmt))) switch (get_gimple_rhs_class (ops.code))
{ {
case GIMPLE_TERNARY_RHS: case GIMPLE_TERNARY_RHS:
ops.op2 = gimple_assign_rhs3 (assign_stmt); ops.op2 = gimple_assign_rhs3 (assign_stmt);
......
...@@ -1347,6 +1347,16 @@ verify_loop_structure (void) ...@@ -1347,6 +1347,16 @@ verify_loop_structure (void)
else else
verify_dominators (CDI_DOMINATORS); verify_dominators (CDI_DOMINATORS);
/* Check the loop tree root. */
if (current_loops->tree_root->header != ENTRY_BLOCK_PTR_FOR_FN (cfun)
|| current_loops->tree_root->latch != EXIT_BLOCK_PTR_FOR_FN (cfun)
|| (current_loops->tree_root->num_nodes
!= (unsigned) n_basic_blocks_for_fn (cfun)))
{
error ("corrupt loop tree root");
err = 1;
}
/* Check the headers. */ /* Check the headers. */
FOR_EACH_BB_FN (bb, cfun) FOR_EACH_BB_FN (bb, cfun)
if (bb_loop_header_p (bb)) if (bb_loop_header_p (bb))
......
...@@ -649,7 +649,7 @@ duplicate_eh_regions (struct function *ifun, ...@@ -649,7 +649,7 @@ duplicate_eh_regions (struct function *ifun,
data.label_map_data = map_data; data.label_map_data = map_data;
data.eh_map = new hash_map<void *, void *>; data.eh_map = new hash_map<void *, void *>;
outer_region = get_eh_region_from_lp_number (outer_lp); outer_region = get_eh_region_from_lp_number_fn (cfun, outer_lp);
/* Copy all the regions in the subtree. */ /* Copy all the regions in the subtree. */
if (copy_region) if (copy_region)
......
...@@ -49,6 +49,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -49,6 +49,7 @@ along with GCC; see the file COPYING3. If not see
#include "ggc.h" #include "ggc.h"
#include "tree-ssa-loop-niter.h" #include "tree-ssa-loop-niter.h"
#include "loop-unroll.h" #include "loop-unroll.h"
#include "tree-scalar-evolution.h"
/* Apply FLAGS to the loop state. */ /* Apply FLAGS to the loop state. */
...@@ -221,6 +222,9 @@ fix_loop_structure (bitmap changed_bbs) ...@@ -221,6 +222,9 @@ fix_loop_structure (bitmap changed_bbs)
timevar_push (TV_LOOP_INIT); timevar_push (TV_LOOP_INIT);
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "fix_loop_structure: fixing up loops for function\n");
/* We need exact and fast dominance info to be available. */ /* We need exact and fast dominance info to be available. */
gcc_assert (dom_info_state (CDI_DOMINATORS) == DOM_OK); gcc_assert (dom_info_state (CDI_DOMINATORS) == DOM_OK);
...@@ -290,6 +294,7 @@ fix_loop_structure (bitmap changed_bbs) ...@@ -290,6 +294,7 @@ fix_loop_structure (bitmap changed_bbs)
} }
/* Finally free deleted loops. */ /* Finally free deleted loops. */
bool any_deleted = false;
FOR_EACH_VEC_ELT (*get_loops (cfun), i, loop) FOR_EACH_VEC_ELT (*get_loops (cfun), i, loop)
if (loop && loop->header == NULL) if (loop && loop->header == NULL)
{ {
...@@ -322,8 +327,14 @@ fix_loop_structure (bitmap changed_bbs) ...@@ -322,8 +327,14 @@ fix_loop_structure (bitmap changed_bbs)
} }
(*get_loops (cfun))[i] = NULL; (*get_loops (cfun))[i] = NULL;
flow_loop_free (loop); flow_loop_free (loop);
any_deleted = true;
} }
/* If we deleted loops then the cached scalar evolutions refering to
those loops become invalid. */
if (any_deleted && scev_initialized_p ())
scev_reset_htab ();
loops_state_clear (LOOPS_NEED_FIXUP); loops_state_clear (LOOPS_NEED_FIXUP);
/* Apply flags to loops. */ /* Apply flags to loops. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment