Commit 8c816ea9 authored by Götz Lindenmaier's avatar Götz Lindenmaier
Browse files

bugfix

[r5281]
parent 9bea3d74
......@@ -860,7 +860,9 @@ void cg_construct(int arr_len, entity ** free_methods_arr) {
static void destruct_walker(ir_node * node, void * env) {
if (get_irn_op(node) == op_Block) {
remove_Block_cg_cfgpred_arr(node);
/* Do not turn Break into Jmp. Better: merge blocks right away. */
/* Do not turn Break into Jmp. Better: merge blocks right away.
Well, but there are Breaks left.
See exc1 from ajacs-rts/Exceptions.java. */
if (get_Block_n_cfgpreds(node) == 1) {
ir_node *pred = get_Block_cfgpred(node, 0);
if (get_irn_op(pred) == op_Break)
......@@ -870,8 +872,8 @@ static void destruct_walker(ir_node * node, void * env) {
set_irg_current_block(current_ir_graph, get_nodes_block(node));
exchange(node, new_Proj(get_Filter_pred(node), get_irn_mode(node), get_Filter_proj(node)));
} else if (get_irn_op(node) == op_Break) {
//set_irg_current_block(current_ir_graph, get_nodes_block(node));
//exchange(node, new_Jmp());
set_irg_current_block(current_ir_graph, get_nodes_block(node));
exchange(node, new_Jmp());
} else if (get_irn_op(node) == op_Call) {
remove_Call_callee_arr(node);
} else if (get_irn_op(node) == op_Proj) {
......@@ -887,13 +889,16 @@ void cg_destruct(void) {
for (i = get_irp_n_irgs() - 1; i >= 0; --i) {
ir_graph * irg = get_irp_irg(i);
irg_walk_graph(irg, destruct_walker, clear_link, NULL);
set_irg_frame(irg, skip_Id(get_irg_frame(irg)));
set_irg_globals(irg, skip_Id(get_irg_globals(irg)));
set_irg_frame (irg, skip_Id(get_irg_frame(irg)));
set_irg_globals (irg, skip_Id(get_irg_globals(irg)));
set_irg_initial_mem(irg, skip_Id(get_irg_initial_mem(irg)));
set_irg_end_reg (irg, get_irg_end(irg));
set_irg_end_except (irg, get_irg_end(irg));
set_irg_callee_info_state(irg, irg_callee_info_none);
set_irg_end_reg(irg, get_irg_end(irg));
set_irg_end_except(irg, get_irg_end(irg));
}
set_irp_ip_view(ip_view_no);
}
}
......@@ -16,6 +16,7 @@
# include "irprog.h"
# include "irgraph_t.h"
# include "ircgcons.h"
# include "irvrfy.h"
# include "irgwalk.h"
# include "irdump.h"
......@@ -525,9 +526,13 @@ vrfy_Proj_proj(ir_node *p, ir_graph *irg) {
break;
case iro_EndReg:
ASSERT_AND_RET((get_irp_ip_view_state() != ip_view_no),
"EndReg may only appear if ip view is constructed.", 0);
break;
case iro_EndExcept:
ASSERT_AND_RET((get_irp_ip_view_state() != ip_view_no),
"EndExcept may only appear if ip view is constructed.", 0);
break;
default:
......@@ -625,10 +630,13 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
break;
case iro_Break:
ASSERT_AND_RET((get_irp_ip_view_state() != ip_view_no),
"Break may only appear if ip view is constructed.", 0);
ASSERT_AND_RET(
/* Jmp: BB --> X */
mymode == mode_X, "Jmp node", 0
mymode == mode_X, "Break node", 0
);
break;
case iro_Cond:
......@@ -1022,6 +1030,7 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
);
break;
case iro_Phi:
{
ir_node *block = get_nodes_block(n);
......@@ -1047,6 +1056,11 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
ASSERT_AND_RET( mode_is_dataM(mymode), "Phi node", 0 );
break;
}
case iro_Filter:
ASSERT_AND_RET((get_irp_ip_view_state() != ip_view_no),
"Filter may only appear if ip view is constructed.", 0);
/* We should further do tests as for Proj and Phi. */
break;
case iro_Load:
op1mode = get_irn_mode(in[1]);
op2mode = get_irn_mode(in[2]);
......
Supports Markdown
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