entity *ent = get_irg_entity(irg);
if (ent) {
- type *ent_type = get_entity_owner(ent);
+ ir_type *ent_type = get_entity_owner(ent);
if (ent_type) {
if (ent_type == get_glob_type())
/**
* Prints a failure message for a proj from Start
*/
-static void show_proj_mode_failure(ir_node *n, type *ty)
+static void show_proj_mode_failure(ir_node *n, ir_type *ty)
{
long proj = get_Proj_proj(n);
ir_mode *m = get_type_mode(ty);
/**
* Show call parameters
*/
-static void show_call_param(ir_node *n, type *mt)
+static void show_call_param(ir_node *n, ir_type *mt)
{
int i;
/**
* Show return modes
*/
-static void show_return_modes(ir_graph *irg, ir_node *n, type *mt, int i)
+static void show_return_modes(ir_graph *irg, ir_node *n, ir_type *mt, int i)
{
entity *ent = get_irg_entity(irg);
/**
* Show return number of results
*/
-static void show_return_nres(ir_graph *irg, ir_node *n, type *mt)
+static void show_return_nres(ir_graph *irg, ir_node *n, ir_type *mt)
{
entity *ent = get_irg_entity(irg);
(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 */
ir_mode *mode = get_irn_mode(p);
long proj = get_Proj_proj(p);
long nr = get_Proj_proj(pred);
- type *mt; /* A method type */
+ ir_type *mt; /* A method type */
pred = skip_Id(get_Proj_pred(pred));
ASSERT_AND_RET((get_irn_mode(pred) == mode_T), "Proj from something not a tuple", 0);
break;
default:
- ASSERT_AND_RET(0, "Unknown opcode", 0);
+ /* ASSERT_AND_RET(0, "Unknown opcode", 0); */
+ break;
}
return 1;
}
long proj = get_Proj_proj(p);
ASSERT_AND_RET_DBG(
- ((proj == pn_CopyB_M && mode == mode_M) ||
- (proj == pn_CopyB_X_except && mode == mode_X)),
+ ((proj == pn_CopyB_M_regular && mode == mode_M) ||
+ (proj == pn_CopyB_X_except && mode == mode_X) ||
+ (proj == pn_CopyB_M_except && mode == mode_M)),
"wrong Proj from CopyB", 0,
show_proj_failure(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) ||
ir_node *pred = skip_Proj(get_Block_cfgpred(n, i));
if (is_Proj(pred) || get_irn_op(pred) == op_Tuple)
break; /* We can not test properly. How many tuples are there? */
- ASSERT_AND_RET(((get_irn_op(pred) == op_Return) ||
+ ASSERT_AND_RET((is_Return(pred) ||
is_Bad(pred) ||
(get_irn_op(pred) == op_Raise) ||
is_fragile_op(pred) ),
int i;
ir_mode *mymode = get_irn_mode(n);
ir_mode *mem_mode = get_irn_mode(get_Return_mem(n));
- type *mt;
+ ir_type *mt;
/* Return: BB x M x data1 x ... x datan --> X */
"Number of results for Return doesn't match number of results in type.", 0,
show_return_nres(irg, n, mt););
for (i = get_Return_n_ress(n) - 1; i >= 0; --i) {
- type *res_type = get_method_res_type(mt, i);
+ ir_type *res_type = get_method_res_type(mt, i);
if (is_atomic_type(res_type)) {
ASSERT_AND_RET_DBG(
mymode == mode_b) /* we want boolean constants for static evaluation */
,"Const node", 0 /* of Cmp. */
);
+ ASSERT_AND_RET(
+ /* the modes of the constant and teh tarval must match */
+ mymode == get_tarval_mode(get_Const_tarval(n)),
+ "Const node, tarval and node mode mismatch", 0
+ );
return 1;
}
ir_mode *mymode = get_irn_mode(n);
ir_mode *op1mode = get_irn_mode(get_Call_mem(n));
ir_mode *op2mode = get_irn_mode(get_Call_ptr(n));
- type *mt;
+ ir_type *mt;
int i;
/* Call: BB x M x ref x data1 x ... x datan
}
for (i = 0; i < get_method_n_params(mt); i++) {
- type *t = get_method_param_type(mt, i);
+ ir_type *t = get_method_param_type(mt, i);
if (is_atomic_type(t)) {
ASSERT_AND_RET_DBG(
ASSERT_AND_RET_DBG(
/* And or Or or Eor: BB x int x int --> int */
- mode_is_int(mymode) &&
+ (mode_is_int(mymode) || mymode == mode_b) &&
op2mode == op1mode &&
mymode == op2mode,
"And, Or or Eor node", 0,
);
}
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;
}
ir_mode *op1mode = get_irn_mode(get_CopyB_mem(n));
ir_mode *op2mode = get_irn_mode(get_CopyB_dst(n));
ir_mode *op3mode = get_irn_mode(get_CopyB_src(n));
- type *t = get_CopyB_type(n);
+ ir_type *t = get_CopyB_type(n);
/* CopyB: BB x M x ref x ref --> M x X */
ASSERT_AND_RET(
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)
{
show_node_on_graph(irg, n);
);
assert(get_irn_irg(n) == irg);
+ {
+ unsigned idx = get_irn_idx(n);
+ ir_node *node_from_map = get_idx_irn(irg, idx);
+ ASSERT_AND_RET_DBG(node_from_map == n, "Node index and index map entry differ", 0, ir_printf("node %+F node in map %+F(%p)", n, node_from_map, node_from_map));
+ }
}
op = get_irn_op(n);
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);