Commit b7dd849f authored by Matthias Braun's avatar Matthias Braun
Browse files

change pn_XXX_max enum to really be the maximum pn and not maximum+1, add n_XXX_max enum

parent 91e6caeb
...@@ -1432,9 +1432,6 @@ static ir_node *gen_Proj_Start(ir_node *node) ...@@ -1432,9 +1432,6 @@ static ir_node *gen_Proj_Start(ir_node *node)
case pn_Start_P_frame_base: case pn_Start_P_frame_base:
return be_prolog_get_reg_value(abihelper, sp_reg); return be_prolog_get_reg_value(abihelper, sp_reg);
case pn_Start_max:
break;
} }
panic("unexpected start proj: %ld\n", proj); panic("unexpected start proj: %ld\n", proj);
} }
...@@ -1560,7 +1557,6 @@ static ir_node *gen_Proj_Call(ir_node *node) ...@@ -1560,7 +1557,6 @@ static ir_node *gen_Proj_Call(ir_node *node)
case pn_Call_X_regular: case pn_Call_X_regular:
case pn_Call_X_except: case pn_Call_X_except:
case pn_Call_T_result: case pn_Call_T_result:
case pn_Call_max:
break; break;
} }
panic("Unexpected Call proj %ld\n", pn); panic("Unexpected Call proj %ld\n", pn);
......
...@@ -286,7 +286,7 @@ enum { ...@@ -286,7 +286,7 @@ enum {
*/ */
typedef enum { typedef enum {
pn_be_Call_M_regular = pn_Call_M, /**< The memory result of a be_Call. */ pn_be_Call_M_regular = pn_Call_M, /**< The memory result of a be_Call. */
pn_be_Call_sp = pn_Call_max, pn_be_Call_sp = pn_Call_max+1,
pn_be_Call_first_res /**< The first result proj number of a pn_be_Call_first_res /**< The first result proj number of a
be_Call. */ be_Call. */
} pn_be_Call; } pn_be_Call;
......
...@@ -154,7 +154,6 @@ static void resolve_call(ir_node *call, ir_node *l_res, ir_node *h_res, ir_graph ...@@ -154,7 +154,6 @@ static void resolve_call(ir_node *call, ir_node *l_res, ir_node *h_res, ir_graph
res = new_r_Tuple(block, 2, in); res = new_r_Tuple(block, 2, in);
} }
turn_into_tuple(call, pn_Call_max);
/* /*
* Beware: * Beware:
* We do not check here if this call really has exception and regular Proj's. * We do not check here if this call really has exception and regular Proj's.
...@@ -167,6 +166,7 @@ static void resolve_call(ir_node *call, ir_node *l_res, ir_node *h_res, ir_graph ...@@ -167,6 +166,7 @@ static void resolve_call(ir_node *call, ir_node *l_res, ir_node *h_res, ir_graph
jmp = new_r_Jmp(block); jmp = new_r_Jmp(block);
set_opt_cse(old_cse); set_opt_cse(old_cse);
turn_into_tuple(call, pn_Call_max+1);
set_Tuple_pred(call, pn_Call_M, nomem); set_Tuple_pred(call, pn_Call_M, nomem);
set_Tuple_pred(call, pn_Call_X_regular, jmp); set_Tuple_pred(call, pn_Call_X_regular, jmp);
set_Tuple_pred(call, pn_Call_X_except, new_r_Bad(irg, mode_X)); set_Tuple_pred(call, pn_Call_X_except, new_r_Bad(irg, mode_X));
......
...@@ -4538,8 +4538,6 @@ static ir_node *gen_Proj_Load(ir_node *node) ...@@ -4538,8 +4538,6 @@ static ir_node *gen_Proj_Load(ir_node *node)
return new_rd_Proj(dbgi, new_pred, mode_X, pn_ia32_Load_X_except); return new_rd_Proj(dbgi, new_pred, mode_X, pn_ia32_Load_X_except);
case pn_Load_X_regular: case pn_Load_X_regular:
return new_rd_Proj(dbgi, new_pred, mode_X, pn_ia32_Load_X_regular); return new_rd_Proj(dbgi, new_pred, mode_X, pn_ia32_Load_X_regular);
case pn_Load_max:
break;
} }
} else if (is_ia32_Conv_I2I(new_pred) || } else if (is_ia32_Conv_I2I(new_pred) ||
is_ia32_Conv_I2I8Bit(new_pred)) { is_ia32_Conv_I2I8Bit(new_pred)) {
...@@ -4561,8 +4559,6 @@ static ir_node *gen_Proj_Load(ir_node *node) ...@@ -4561,8 +4559,6 @@ static ir_node *gen_Proj_Load(ir_node *node)
return new_rd_Proj(dbgi, new_pred, mode_X, pn_ia32_xLoad_X_except); return new_rd_Proj(dbgi, new_pred, mode_X, pn_ia32_xLoad_X_except);
case pn_Load_X_regular: case pn_Load_X_regular:
return new_rd_Proj(dbgi, new_pred, mode_X, pn_ia32_xLoad_X_regular); return new_rd_Proj(dbgi, new_pred, mode_X, pn_ia32_xLoad_X_regular);
case pn_Load_max:
break;
} }
} else if (is_ia32_vfld(new_pred)) { } else if (is_ia32_vfld(new_pred)) {
switch ((pn_Load)proj) { switch ((pn_Load)proj) {
...@@ -4576,8 +4572,6 @@ static ir_node *gen_Proj_Load(ir_node *node) ...@@ -4576,8 +4572,6 @@ static ir_node *gen_Proj_Load(ir_node *node)
return new_rd_Proj(dbgi, new_pred, mode_X, pn_ia32_vfld_X_except); return new_rd_Proj(dbgi, new_pred, mode_X, pn_ia32_vfld_X_except);
case pn_Load_X_regular: case pn_Load_X_regular:
return new_rd_Proj(dbgi, new_pred, mode_X, pn_ia32_vfld_X_regular); return new_rd_Proj(dbgi, new_pred, mode_X, pn_ia32_vfld_X_regular);
case pn_Load_max:
break;
} }
} else { } else {
/* can happen for ProJMs when source address mode happened for the /* can happen for ProJMs when source address mode happened for the
...@@ -4634,8 +4628,6 @@ static ir_node *gen_Proj_Div(ir_node *node) ...@@ -4634,8 +4628,6 @@ static ir_node *gen_Proj_Div(ir_node *node)
return new_rd_Proj(dbgi, new_pred, mode_X, pn_ia32_Div_X_except); return new_rd_Proj(dbgi, new_pred, mode_X, pn_ia32_Div_X_except);
case pn_Div_X_regular: case pn_Div_X_regular:
return new_rd_Proj(dbgi, new_pred, mode_X, pn_ia32_Div_X_regular); return new_rd_Proj(dbgi, new_pred, mode_X, pn_ia32_Div_X_regular);
case pn_Div_max:
break;
} }
panic("No idea how to transform proj->Div"); panic("No idea how to transform proj->Div");
...@@ -4665,8 +4657,6 @@ static ir_node *gen_Proj_Mod(ir_node *node) ...@@ -4665,8 +4657,6 @@ static ir_node *gen_Proj_Mod(ir_node *node)
return new_rd_Proj(dbgi, new_pred, mode_X, pn_ia32_Div_X_except); return new_rd_Proj(dbgi, new_pred, mode_X, pn_ia32_Div_X_except);
case pn_Mod_X_regular: case pn_Mod_X_regular:
return new_rd_Proj(dbgi, new_pred, mode_X, pn_ia32_Div_X_regular); return new_rd_Proj(dbgi, new_pred, mode_X, pn_ia32_Div_X_regular);
case pn_Mod_max:
break;
} }
panic("No idea how to transform proj->Mod"); panic("No idea how to transform proj->Mod");
} }
......
...@@ -1926,8 +1926,6 @@ static ir_node *gen_Proj_Start(ir_node *node) ...@@ -1926,8 +1926,6 @@ static ir_node *gen_Proj_Start(ir_node *node)
return new_r_Bad(get_irn_irg(block), mode_T); return new_r_Bad(get_irn_irg(block), mode_T);
case pn_Start_P_frame_base: case pn_Start_P_frame_base:
return get_frame_base(); return get_frame_base();
case pn_Start_max:
break;
} }
panic("Unexpected start proj: %ld\n", pn); panic("Unexpected start proj: %ld\n", pn);
} }
...@@ -2006,7 +2004,6 @@ static ir_node *gen_Proj_Call(ir_node *node) ...@@ -2006,7 +2004,6 @@ static ir_node *gen_Proj_Call(ir_node *node)
case pn_Call_X_regular: case pn_Call_X_regular:
case pn_Call_X_except: case pn_Call_X_except:
case pn_Call_T_result: case pn_Call_T_result:
case pn_Call_max:
break; break;
} }
panic("Unexpected Call proj %ld\n", pn); panic("Unexpected Call proj %ld\n", pn);
......
...@@ -49,10 +49,10 @@ ...@@ -49,10 +49,10 @@
/* some constants fixing the positions of nodes predecessors /* some constants fixing the positions of nodes predecessors
in the in array */ in the in array */
#define CALL_PARAM_OFFSET 2 #define CALL_PARAM_OFFSET (n_Call_max+1)
#define BUILDIN_PARAM_OFFSET 1 #define BUILTIN_PARAM_OFFSET (n_Builtin_max+1)
#define SEL_INDEX_OFFSET 2 #define SEL_INDEX_OFFSET (n_Sel_max+1)
#define RETURN_RESULT_OFFSET 1 /* mem is not a result */ #define RETURN_RESULT_OFFSET (n_Return_max+1)
#define END_KEEPALIVE_OFFSET 0 #define END_KEEPALIVE_OFFSET 0
static const char *relation_names [] = { static const char *relation_names [] = {
...@@ -989,25 +989,25 @@ void set_Call_param(ir_node *node, int pos, ir_node *param) ...@@ -989,25 +989,25 @@ void set_Call_param(ir_node *node, int pos, ir_node *param)
ir_node **get_Builtin_param_arr(ir_node *node) ir_node **get_Builtin_param_arr(ir_node *node)
{ {
assert(is_Builtin(node)); assert(is_Builtin(node));
return &get_irn_in(node)[BUILDIN_PARAM_OFFSET + 1]; return &get_irn_in(node)[BUILTIN_PARAM_OFFSET + 1];
} }
int get_Builtin_n_params(const ir_node *node) int get_Builtin_n_params(const ir_node *node)
{ {
assert(is_Builtin(node)); assert(is_Builtin(node));
return (get_irn_arity(node) - BUILDIN_PARAM_OFFSET); return (get_irn_arity(node) - BUILTIN_PARAM_OFFSET);
} }
ir_node *get_Builtin_param(const ir_node *node, int pos) ir_node *get_Builtin_param(const ir_node *node, int pos)
{ {
assert(is_Builtin(node)); assert(is_Builtin(node));
return get_irn_n(node, pos + BUILDIN_PARAM_OFFSET); return get_irn_n(node, pos + BUILTIN_PARAM_OFFSET);
} }
void set_Builtin_param(ir_node *node, int pos, ir_node *param) void set_Builtin_param(ir_node *node, int pos, ir_node *param)
{ {
assert(is_Builtin(node)); assert(is_Builtin(node));
set_irn_n(node, pos + BUILDIN_PARAM_OFFSET, param); set_irn_n(node, pos + BUILTIN_PARAM_OFFSET, param);
} }
/* Returns a human readable string for the ir_builtin_kind. */ /* Returns a human readable string for the ir_builtin_kind. */
......
...@@ -2665,7 +2665,7 @@ make_tuple: ...@@ -2665,7 +2665,7 @@ make_tuple:
/* skip a potential Pin */ /* skip a potential Pin */
mem = skip_Pin(mem); mem = skip_Pin(mem);
turn_into_tuple(n, pn_Div_max); turn_into_tuple(n, pn_Div_max+1);
set_Tuple_pred(n, pn_Div_M, mem); set_Tuple_pred(n, pn_Div_M, mem);
set_Tuple_pred(n, pn_Div_X_regular, new_r_Jmp(blk)); set_Tuple_pred(n, pn_Div_X_regular, new_r_Jmp(blk));
set_Tuple_pred(n, pn_Div_X_except, new_r_Bad(irg, mode_X)); set_Tuple_pred(n, pn_Div_X_except, new_r_Bad(irg, mode_X));
...@@ -2757,7 +2757,7 @@ make_tuple: ...@@ -2757,7 +2757,7 @@ make_tuple:
/* skip a potential Pin */ /* skip a potential Pin */
mem = skip_Pin(mem); mem = skip_Pin(mem);
turn_into_tuple(n, pn_Mod_max); turn_into_tuple(n, pn_Mod_max+1);
set_Tuple_pred(n, pn_Mod_M, mem); set_Tuple_pred(n, pn_Mod_M, mem);
set_Tuple_pred(n, pn_Mod_X_regular, new_r_Jmp(blk)); set_Tuple_pred(n, pn_Mod_X_regular, new_r_Jmp(blk));
set_Tuple_pred(n, pn_Mod_X_except, new_r_Bad(irg, mode_X)); set_Tuple_pred(n, pn_Mod_X_except, new_r_Bad(irg, mode_X));
...@@ -2791,7 +2791,7 @@ static ir_node *transform_node_Cond(ir_node *n) ...@@ -2791,7 +2791,7 @@ static ir_node *transform_node_Cond(ir_node *n)
Replace it by a tuple (Bad, Jmp) or (Jmp, Bad) */ Replace it by a tuple (Bad, Jmp) or (Jmp, Bad) */
ir_node *blk = get_nodes_block(n); ir_node *blk = get_nodes_block(n);
jmp = new_r_Jmp(blk); jmp = new_r_Jmp(blk);
turn_into_tuple(n, pn_Cond_max); turn_into_tuple(n, pn_Cond_max+1);
if (ta == tarval_b_true) { if (ta == tarval_b_true) {
set_Tuple_pred(n, pn_Cond_false, new_r_Bad(irg, mode_X)); set_Tuple_pred(n, pn_Cond_false, new_r_Bad(irg, mode_X));
set_Tuple_pred(n, pn_Cond_true, jmp); set_Tuple_pred(n, pn_Cond_true, jmp);
...@@ -5833,7 +5833,7 @@ static ir_node *transform_node_Load(ir_node *n) ...@@ -5833,7 +5833,7 @@ static ir_node *transform_node_Load(ir_node *n)
ir_node *bad = new_r_Bad(irg, mode_X); ir_node *bad = new_r_Bad(irg, mode_X);
ir_mode *mode = get_Load_mode(n); ir_mode *mode = get_Load_mode(n);
ir_node *res = new_r_Proj(pred_load, mode, pn_Load_res); ir_node *res = new_r_Proj(pred_load, mode, pn_Load_res);
ir_node *in[pn_Load_max] = { mem, jmp, bad, res }; ir_node *in[pn_Load_max+1] = { mem, jmp, bad, res };
ir_node *tuple = new_r_Tuple(block, ARRAY_SIZE(in), in); ir_node *tuple = new_r_Tuple(block, ARRAY_SIZE(in), in);
return tuple; return tuple;
} }
...@@ -5853,7 +5853,7 @@ static ir_node *transform_node_Load(ir_node *n) ...@@ -5853,7 +5853,7 @@ static ir_node *transform_node_Load(ir_node *n)
ir_graph *irg = get_irn_irg(n); ir_graph *irg = get_irn_irg(n);
ir_node *bad = new_r_Bad(irg, mode_X); ir_node *bad = new_r_Bad(irg, mode_X);
ir_node *res = value; ir_node *res = value;
ir_node *in[pn_Load_max] = { mem, jmp, bad, res }; ir_node *in[pn_Load_max+1] = { mem, jmp, bad, res };
ir_node *tuple = new_r_Tuple(block, ARRAY_SIZE(in), in); ir_node *tuple = new_r_Tuple(block, ARRAY_SIZE(in), in);
return tuple; return tuple;
} }
......
...@@ -497,7 +497,7 @@ static void add_hidden_param(ir_graph *irg, size_t n_com, ir_node **ins, cl_entr ...@@ -497,7 +497,7 @@ static void add_hidden_param(ir_graph *irg, size_t n_com, ir_node **ins, cl_entr
blk = get_nodes_block(p); blk = get_nodes_block(p);
/* get rid of the CopyB */ /* get rid of the CopyB */
turn_into_tuple(p, pn_CopyB_max); turn_into_tuple(p, pn_CopyB_max+1);
set_Tuple_pred(p, pn_CopyB_M, mem); set_Tuple_pred(p, pn_CopyB_M, mem);
set_Tuple_pred(p, pn_CopyB_X_regular, new_r_Jmp(blk)); set_Tuple_pred(p, pn_CopyB_X_regular, new_r_Jmp(blk));
set_Tuple_pred(p, pn_CopyB_X_except, new_r_Bad(irg, mode_X)); set_Tuple_pred(p, pn_CopyB_X_except, new_r_Bad(irg, mode_X));
......
...@@ -118,7 +118,7 @@ static void lower_copyb_nodes(ir_node *irn, unsigned mode_bytes) ...@@ -118,7 +118,7 @@ static void lower_copyb_nodes(ir_node *irn, unsigned mode_bytes)
mode_bytes /= 2; mode_bytes /= 2;
} }
turn_into_tuple(irn, pn_CopyB_max); turn_into_tuple(irn, pn_CopyB_max+1);
set_Tuple_pred(irn, pn_CopyB_M, mem); set_Tuple_pred(irn, pn_CopyB_M, mem);
set_Tuple_pred(irn, pn_CopyB_X_regular, new_r_Bad(irg, mode_X)); set_Tuple_pred(irn, pn_CopyB_X_regular, new_r_Bad(irg, mode_X));
set_Tuple_pred(irn, pn_CopyB_X_except, new_r_Bad(irg, mode_X)); set_Tuple_pred(irn, pn_CopyB_X_except, new_r_Bad(irg, mode_X));
......
...@@ -225,7 +225,7 @@ static void replace_call(ir_node *irn, ir_node *call, ir_node *mem, ir_node *reg ...@@ -225,7 +225,7 @@ static void replace_call(ir_node *irn, ir_node *call, ir_node *mem, ir_node *reg
} }
irn = new_r_Tuple(block, 1, &irn); irn = new_r_Tuple(block, 1, &irn);
turn_into_tuple(call, pn_Call_max); turn_into_tuple(call, pn_Call_max+1);
set_Tuple_pred(call, pn_Call_M, mem); set_Tuple_pred(call, pn_Call_M, mem);
set_Tuple_pred(call, pn_Call_X_regular, reg_jmp); set_Tuple_pred(call, pn_Call_X_regular, reg_jmp);
set_Tuple_pred(call, pn_Call_X_except, exc_jmp); set_Tuple_pred(call, pn_Call_X_except, exc_jmp);
......
...@@ -393,7 +393,7 @@ static void transform_allocs(ir_graph *irg, walk_env_t *env) ...@@ -393,7 +393,7 @@ static void transform_allocs(ir_graph *irg, walk_env_t *env)
mem = get_Alloc_mem(alloc); mem = get_Alloc_mem(alloc);
blk = get_nodes_block(alloc); blk = get_nodes_block(alloc);
turn_into_tuple(alloc, pn_Alloc_max); turn_into_tuple(alloc, pn_Alloc_max+1);
set_Tuple_pred(alloc, pn_Alloc_M, mem); set_Tuple_pred(alloc, pn_Alloc_M, mem);
set_Tuple_pred(alloc, pn_Alloc_X_regular, new_r_Jmp(blk)); set_Tuple_pred(alloc, pn_Alloc_X_regular, new_r_Jmp(blk));
set_Tuple_pred(alloc, pn_Alloc_X_except, new_r_Bad(irg, mode_X)); set_Tuple_pred(alloc, pn_Alloc_X_except, new_r_Bad(irg, mode_X));
...@@ -438,7 +438,7 @@ static void transform_allocs(ir_graph *irg, walk_env_t *env) ...@@ -438,7 +438,7 @@ static void transform_allocs(ir_graph *irg, walk_env_t *env)
sel = new_rd_simpleSel(dbg, get_nodes_block(alloc), get_irg_no_mem(irg), get_irg_frame(irg), ent); sel = new_rd_simpleSel(dbg, get_nodes_block(alloc), get_irg_no_mem(irg), get_irg_frame(irg), ent);
mem = get_Alloc_mem(alloc); mem = get_Alloc_mem(alloc);
turn_into_tuple(alloc, pn_Alloc_max); turn_into_tuple(alloc, pn_Alloc_max+1);
set_Tuple_pred(alloc, pn_Alloc_M, mem); set_Tuple_pred(alloc, pn_Alloc_M, mem);
set_Tuple_pred(alloc, pn_Alloc_X_regular, new_r_Jmp(blk)); set_Tuple_pred(alloc, pn_Alloc_X_regular, new_r_Jmp(blk));
set_Tuple_pred(alloc, pn_Alloc_X_except, new_r_Bad(irg, mode_X)); set_Tuple_pred(alloc, pn_Alloc_X_except, new_r_Bad(irg, mode_X));
...@@ -481,7 +481,7 @@ static void transform_alloc_calls(ir_graph *irg, walk_env_t *env) ...@@ -481,7 +481,7 @@ static void transform_alloc_calls(ir_graph *irg, walk_env_t *env)
mem = get_Call_mem(call); mem = get_Call_mem(call);
blk = get_nodes_block(call); blk = get_nodes_block(call);
turn_into_tuple(call, pn_Call_max); turn_into_tuple(call, pn_Call_max+1);
set_Tuple_pred(call, pn_Call_M, mem); set_Tuple_pred(call, pn_Call_M, mem);
set_Tuple_pred(call, pn_Call_X_regular, new_r_Jmp(blk)); set_Tuple_pred(call, pn_Call_X_regular, new_r_Jmp(blk));
set_Tuple_pred(call, pn_Call_X_except, new_r_Bad(irg, mode_X)); set_Tuple_pred(call, pn_Call_X_except, new_r_Bad(irg, mode_X));
......
...@@ -74,7 +74,7 @@ typedef struct walk_env_t { ...@@ -74,7 +74,7 @@ typedef struct walk_env_t {
/** A Load/Store info. */ /** A Load/Store info. */
typedef struct ldst_info_t { typedef struct ldst_info_t {
ir_node *projs[MAX_PROJ]; /**< list of Proj's of this node */ ir_node *projs[MAX_PROJ+1]; /**< list of Proj's of this node */
ir_node *exc_block; /**< the exception block if available */ ir_node *exc_block; /**< the exception block if available */
int exc_idx; /**< predecessor index in the exception block */ int exc_idx; /**< predecessor index in the exception block */
unsigned visited; /**< visited counter for breaking loops */ unsigned visited; /**< visited counter for breaking loops */
......
...@@ -299,7 +299,7 @@ int inline_method(ir_node *call, ir_graph *called_graph) ...@@ -299,7 +299,7 @@ int inline_method(ir_node *call, ir_graph *called_graph)
{ {
ir_node *pre_call; ir_node *pre_call;
ir_node *post_call, *post_bl; ir_node *post_call, *post_bl;
ir_node *in[pn_Start_max]; ir_node *in[pn_Start_max+1];
ir_node *end, *end_bl, *block; ir_node *end, *end_bl, *block;
ir_node **res_pred; ir_node **res_pred;
ir_node **cf_pred; ir_node **cf_pred;
...@@ -392,7 +392,7 @@ int inline_method(ir_node *call, ir_graph *called_graph) ...@@ -392,7 +392,7 @@ int inline_method(ir_node *call, ir_graph *called_graph)
in[pn_Start_X_initial_exec] = new_r_Jmp(post_bl); in[pn_Start_X_initial_exec] = new_r_Jmp(post_bl);
in[pn_Start_P_frame_base] = get_irg_frame(irg); in[pn_Start_P_frame_base] = get_irg_frame(irg);
in[pn_Start_T_args] = new_r_Tuple(post_bl, n_params, args_in); in[pn_Start_T_args] = new_r_Tuple(post_bl, n_params, args_in);
pre_call = new_r_Tuple(post_bl, pn_Start_max, in); pre_call = new_r_Tuple(post_bl, pn_Start_max+1, in);
post_call = call; post_call = call;
/* -- /* --
...@@ -485,7 +485,7 @@ int inline_method(ir_node *call, ir_graph *called_graph) ...@@ -485,7 +485,7 @@ int inline_method(ir_node *call, ir_graph *called_graph)
/* build a Tuple for all results of the method. /* build a Tuple for all results of the method.
* add Phi node if there was more than one Return. */ * add Phi node if there was more than one Return. */
turn_into_tuple(post_call, pn_Call_max); turn_into_tuple(post_call, pn_Call_max+1);
/* First the Memory-Phi */ /* First the Memory-Phi */
n_mem_phi = 0; n_mem_phi = 0;
for (i = 0; i < arity; i++) { for (i = 0; i < arity; i++) {
......
...@@ -90,7 +90,7 @@ struct memop_t { ...@@ -90,7 +90,7 @@ struct memop_t {
memop_t *next; /**< links to the next memory op in the block in forward order. */ memop_t *next; /**< links to the next memory op in the block in forward order. */
memop_t *prev; /**< links to the previous memory op in the block in forward order. */ memop_t *prev; /**< links to the previous memory op in the block in forward order. */
unsigned flags; /**< memop flags */ unsigned flags; /**< memop flags */
ir_node *projs[MAX_PROJ]; /**< Projs of this memory op */ ir_node *projs[MAX_PROJ+1]; /**< Projs of this memory op */
}; };
/** /**
......
...@@ -608,7 +608,7 @@ static void topologic_walker(ir_node *node, void *ctx) ...@@ -608,7 +608,7 @@ static void topologic_walker(ir_node *node, void *ctx)
val = new_rd_Conv(get_irn_dbg_info(node), block, val, mode); val = new_rd_Conv(get_irn_dbg_info(node), block, val, mode);
mem = get_Load_mem(node); mem = get_Load_mem(node);
turn_into_tuple(node, pn_Load_max); turn_into_tuple(node, pn_Load_max+1);
set_Tuple_pred(node, pn_Load_M, mem); set_Tuple_pred(node, pn_Load_M, mem);
set_Tuple_pred(node, pn_Load_res, val); set_Tuple_pred(node, pn_Load_res, val);
set_Tuple_pred(node, pn_Load_X_regular, new_r_Jmp(block)); set_Tuple_pred(node, pn_Load_X_regular, new_r_Jmp(block));
...@@ -645,7 +645,7 @@ static void topologic_walker(ir_node *node, void *ctx) ...@@ -645,7 +645,7 @@ static void topologic_walker(ir_node *node, void *ctx)
set_value(vnum, val); set_value(vnum, val);
mem = get_Store_mem(node); mem = get_Store_mem(node);
turn_into_tuple(node, pn_Store_max); turn_into_tuple(node, pn_Store_max+1);
set_Tuple_pred(node, pn_Store_M, mem); set_Tuple_pred(node, pn_Store_M, mem);
set_Tuple_pred(node, pn_Store_X_regular, new_r_Jmp(block)); set_Tuple_pred(node, pn_Store_X_regular, new_r_Jmp(block));
set_Tuple_pred(node, pn_Store_X_except, new_r_Bad(irg, mode_X)); set_Tuple_pred(node, pn_Store_X_except, new_r_Bad(irg, mode_X));
......
...@@ -337,7 +337,7 @@ static void do_opt_tail_rec(ir_graph *irg, tr_env *env) ...@@ -337,7 +337,7 @@ static void do_opt_tail_rec(ir_graph *irg, tr_env *env)
/* create a new tuple for the return values */ /* create a new tuple for the return values */
tuple = new_r_Tuple(block, env->n_ress, in); tuple = new_r_Tuple(block, env->n_ress, in);
turn_into_tuple(call, pn_Call_max); turn_into_tuple(call, pn_Call_max+1);
set_Tuple_pred(call, pn_Call_M, mem); set_Tuple_pred(call, pn_Call_M, mem);
set_Tuple_pred(call, pn_Call_X_regular, jmp); set_Tuple_pred(call, pn_Call_X_regular, jmp);
set_Tuple_pred(call, pn_Call_X_except, new_r_Bad(irg, mode_X)); set_Tuple_pred(call, pn_Call_X_except, new_r_Bad(irg, mode_X));
......
...@@ -493,6 +493,7 @@ typedef enum { ...@@ -493,6 +493,7 @@ typedef enum {
{%- for input in node.ins %} {%- for input in node.ins %}
n_{{node.name}}_{{input[0]}}, n_{{node.name}}_{{input[0]}},
{%- endfor %} {%- endfor %}
n_{{node.name}}_max = n_{{node.name}}_{{node.ins[-1][0]}}
} n_{{node.name}}; } n_{{node.name}};
{% endif %} {% endif %}
{% if node.outs %} {% if node.outs %}
...@@ -504,7 +505,7 @@ typedef enum { ...@@ -504,7 +505,7 @@ typedef enum {
pn_{{node.name}}_{{out[0]}} pn_{{node.name}}_{{out[0]}}
{%- if out.__len__() > 2 %} = {{out[2]}}{% endif %}, /**< {{out[1]}} */ {%- if out.__len__() > 2 %} = {{out[2]}}{% endif %}, /**< {{out[1]}} */
{% endfor -%} {% endfor -%}
pn_{{node.name}}_max pn_{{node.name}}_max = pn_{{node.name}}_{{node.outs[-1][0]}}
} pn_{{node.name}}; } pn_{{node.name}};
{% endif %} {% endif %}
{%- endfor %} {%- endfor %}
......
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