X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firvrfy.c;h=06825ba48332ed044c229b58e60143aea46aae66;hb=ed9c74ceca0655fb484f0537dbea43afa2ca0a7e;hp=a280f148ad693a7ac8d23d4efcf6b5e804e5b5a4;hpb=94f1de48c78c75a241df9812f74f3955ee2e6670;p=libfirm diff --git a/ir/ir/irvrfy.c b/ir/ir/irvrfy.c index a280f148a..06825ba48 100644 --- a/ir/ir/irvrfy.c +++ b/ir/ir/irvrfy.c @@ -300,6 +300,7 @@ static int verify_node_Proj_Start(ir_node *n, ir_node *p) { (proj == pn_Start_M && mode == mode_M) || (proj == pn_Start_P_frame_base && mode_is_reference(mode)) || (proj == pn_Start_P_globals && mode_is_reference(mode)) || + (proj == pn_Start_P_tls && mode_is_reference(mode)) || (proj == pn_Start_T_args && mode == mode_T) || (proj == pn_Start_P_value_arg_base && mode_is_reference(mode)) || (proj == pn_Start_P_value_arg_base && mode == mode_T) /* FIXME: only one of those */ @@ -722,6 +723,9 @@ static int verify_node_Proj_Bound(ir_node *n, ir_node *p) { ir_mode *mode = get_irn_mode(p); long proj = get_Proj_proj(p); + /* ignore Bound checks of Bad */ + if (is_Bad(get_Bound_index(n))) + return 1; ASSERT_AND_RET_DBG( ((proj == pn_Bound_M && mode == mode_M) || (proj == pn_Bound_X_except && mode == mode_X) || @@ -1426,6 +1430,32 @@ static int verify_node_Phi(ir_node *n, ir_graph *irg) { ); } ASSERT_AND_RET( mode_is_dataM(mymode), "Phi node", 0 ); + + if (mymode == mode_M) { + for (i = get_Phi_n_preds(n) - 1; i >= 0; --i) { + int j; + ir_node *pred_i = get_Phi_pred(n, i); + + if (is_Bad(pred_i)) + continue; + for (j = i - 1; j >= 0; --j) { + ir_node *pred_j = get_Phi_pred(n, j); + + if (is_Bad(pred_j)) + continue; +#if 0 + /* currently this checks fails for blocks with exception + outputs (and these are NOT basic blocks). So it is disabled yet. */ + ASSERT_AND_RET_DBG( + (pred_i == pred_j) || (get_irn_n(pred_i, -1) != get_irn_n(pred_j, -1)), + "At least two different PhiM predecessors are in the same block", + 0, + ir_printf("%+F and %+F of %+F are in %+F\n", pred_i, pred_j, n, get_irn_n(pred_i, -1)) + ); +#endif + } + } + } return 1; } @@ -1657,11 +1687,13 @@ static int verify_node_Bound(ir_node *n, ir_graph *irg) { return 1; } -/* +/** * Check dominance. * For each usage of a node, it is checked, if the block of the * node dominates the block of the usage (for phis: the predecessor * block of the phi for the corresponding edge). + * + * @return non-zero on success, 0 on dominance error */ static int check_dominance_for_node(ir_node *use) { @@ -1831,7 +1863,7 @@ int irn_vrfy_irg_dump(ir_node *n, ir_graph *irg, const char **bad_string) firm_vrfy_failure_msg = NULL; do_node_verification(FIRM_VERIFICATION_ERROR_ONLY); res = irn_vrfy_irg(n, irg); - if (! res && get_irg_dom_state(irg) == dom_consistent && + if (res && get_irg_dom_state(irg) == dom_consistent && get_irg_pinned(irg) == op_pin_state_pinned) res = check_dominance_for_node(n); do_node_verification(old);