#include "tm_p.h"
#include "basic-block.h"
#include "output.h"
-#include "toplev.h"
+#include "diagnostic-core.h"
#include "flags.h"
#include "function.h"
#include "ggc.h"
#include "timevar.h"
#include "tree-dump.h"
#include "tree-pass.h"
-#include "toplev.h"
#include "except.h"
#include "cfgloop.h"
#include "cfglayout.h"
|| (single_succ_edge (bb)->flags & EDGE_ABNORMAL))
return false;
-#if ENABLE_CHECKING
- gcc_assert (bb != ENTRY_BLOCK_PTR);
-#endif
+ gcc_checking_assert (bb != ENTRY_BLOCK_PTR);
locus = single_succ_edge (bb)->goto_locus;
return true;
}
-/* Return true if BB has at least one abnormal incoming edge. */
-
-static inline bool
-has_abnormal_incoming_edge_p (basic_block bb)
-{
- edge e;
- edge_iterator ei;
-
- FOR_EACH_EDGE (e, ei, bb->preds)
- if (e->flags & EDGE_ABNORMAL)
- return true;
-
- return false;
-}
-
/* If all the PHI nodes in DEST have alternatives for E1 and E2 and
those alternatives are equal in each of the PHI nodes, then return
true, else return false. */
So if there is an abnormal edge to BB, proceed only if there is
no abnormal edge to DEST and there are no phi nodes in DEST. */
- if (has_abnormal_incoming_edge_p (bb)
- && (has_abnormal_incoming_edge_p (dest)
+ if (bb_has_abnormal_pred (bb)
+ && (bb_has_abnormal_pred (dest)
|| !gimple_seq_empty_p (phi_nodes (dest))))
return false;
tree op = gimple_call_lhs (stmt);
gimple_call_set_lhs (stmt, NULL_TREE);
- /* We need to remove SSA name to avoid checking.
+ /* We need to remove SSA name to avoid checking errors.
All uses are dominated by the noreturn and thus will
be removed afterwards.
We proactively remove affected non-PHI statements to avoid
update_stmt (stmt);
changed = true;
}
+ /* Similarly remove VDEF if there is any. */
+ else if (gimple_vdef (stmt))
+ update_stmt (stmt);
return changed;
}
static void
repair_loop_structures (void)
{
- bitmap changed_bbs = BITMAP_ALLOC (NULL);
+ bitmap changed_bbs;
+
+ timevar_push (TV_REPAIR_LOOPS);
+ changed_bbs = BITMAP_ALLOC (NULL);
fix_loop_structure (changed_bbs);
/* This usually does nothing. But sometimes parts of cfg that originally
scev_reset ();
loops_state_clear (LOOPS_NEED_FIXUP);
+ timevar_pop (TV_REPAIR_LOOPS);
}
/* Cleanup cfg and repair loop structures. */
redirection, replace it with the PHI argument that used
to be on E. */
head = redirect_edge_var_map_vector (e);
- for (i = 0; VEC_iterate (edge_var_map, head, i, vm); ++i)
+ FOR_EACH_VEC_ELT (edge_var_map, head, i, vm)
{
tree old_arg = redirect_edge_var_map_result (vm);
tree new_arg = redirect_edge_var_map_def (vm);
if (gimple_seq_empty_p (phi_nodes (dest))
/* We don't want to deal with a basic block with
abnormal edges. */
- || has_abnormal_incoming_edge_p (bb))
+ || bb_has_abnormal_pred (bb))
continue;
if (!dominated_by_p (CDI_DOMINATORS, dest, bb))