X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Fopt_ldst.c;h=dcf7513cc5e92c4cf553cb3bfeb59d4a787b6c74;hb=3398ae4a8b3cbf66cb0b274ddcd85a2ea863ece1;hp=98b7dfdc07ba6dd272a23c80ba3d4a6acd3e3f8b;hpb=842280b66974a618f663838a489fd5059300e3b0;p=libfirm diff --git a/ir/opt/opt_ldst.c b/ir/opt/opt_ldst.c index 98b7dfdc0..dcf7513cc 100644 --- a/ir/opt/opt_ldst.c +++ b/ir/opt/opt_ldst.c @@ -45,7 +45,7 @@ #include "irpass.h" /* maximum number of output Proj's */ -#define MAX_PROJ (pn_Load_max > pn_Store_max ? pn_Load_max : pn_Store_max) +#define MAX_PROJ ((long)pn_Load_max > (long)pn_Store_max ? (long)pn_Load_max : (long)pn_Store_max) /** * Mapping an address to an dense ID. @@ -216,14 +216,14 @@ static block_t *get_block_entry(const ir_node *block) { assert(is_Block(block)); - return get_irn_link(block); + return (block_t*)get_irn_link(block); } /* get_block_entry */ /** Get the memop entry for a memory operation node */ static memop_t *get_irn_memop(const ir_node *irn) { assert(! is_Block(irn)); - return get_irn_link(irn); + return (memop_t*)get_irn_link(irn); } /* get_irn_memop */ /** @@ -312,7 +312,7 @@ restart: goto restart; } - entry = ir_nodemap_get(&env.adr_map, adr); + entry = (address_entry*)ir_nodemap_get(&env.adr_map, adr); if (entry == NULL) { /* new address */ @@ -561,10 +561,10 @@ static ir_entity *find_constant_entity(ir_node *ptr) int i, n; for (i = 0, n = get_Sel_n_indexs(ptr); i < n; ++i) { - ir_node *bound; - tarval *tlower, *tupper; - ir_node *index = get_Sel_index(ptr, i); - tarval *tv = computed_value(index); + ir_node *bound; + ir_tarval *tlower, *tupper; + ir_node *index = get_Sel_index(ptr, i); + ir_tarval *tv = computed_value(index); /* check if the index is constant */ if (tv == tarval_bad) @@ -645,7 +645,7 @@ static compound_graph_path *rec_get_accessed_path(ir_node *ptr, int depth) compound_graph_path *res = NULL; ir_entity *root, *field, *ent; int path_len, pos, idx; - tarval *tv; + ir_tarval *tv; ir_type *tp; if (is_SymConst(ptr)) { @@ -673,17 +673,19 @@ static compound_graph_path *rec_get_accessed_path(ir_node *ptr, int depth) set_compound_graph_path_array_index(res, pos, get_Sel_array_index_long(ptr, 0)); } } else if (is_Add(ptr)) { - ir_node *l = get_Add_left(ptr); - ir_node *r = get_Add_right(ptr); - ir_mode *mode = get_irn_mode(ptr); - tarval *tmp; - - if (is_Const(r) && get_irn_mode(l) == mode) { - ptr = l; - tv = get_Const_tarval(r); - } else { - ptr = r; - tv = get_Const_tarval(l); + ir_mode *mode; + ir_tarval *tmp; + + { + ir_node *l = get_Add_left(ptr); + ir_node *r = get_Add_right(ptr); + if (is_Const(r) && get_irn_mode(l) == get_irn_mode(ptr)) { + ptr = l; + tv = get_Const_tarval(r); + } else { + ptr = r; + tv = get_Const_tarval(l); + } } ptr_arith: mode = get_tarval_mode(tv); @@ -697,9 +699,9 @@ ptr_arith: } idx = 0; for (ent = field;;) { - unsigned size; - tarval *sz, *tv_index, *tlower, *tupper; - ir_node *bound; + unsigned size; + ir_tarval *sz, *tv_index, *tlower, *tupper; + ir_node *bound; tp = get_entity_type(ent); if (! is_Array_type(tp)) @@ -748,9 +750,9 @@ ptr_arith: pos = path_len - depth - idx; for (ent = field;;) { - unsigned size; - tarval *sz, *tv_index; - long index; + unsigned size; + ir_tarval *sz, *tv_index; + long index; tp = get_entity_type(ent); if (! is_Array_type(tp)) @@ -805,7 +807,7 @@ static ir_node *rec_find_compound_ent_value(ir_node *ptr, path_entry *next) path_entry entry, *p; ir_entity *ent, *field; ir_initializer_t *initializer; - tarval *tv; + ir_tarval *tv; ir_type *tp; unsigned n; @@ -876,17 +878,19 @@ static ir_node *rec_find_compound_ent_value(ir_node *ptr, path_entry *next) } return rec_find_compound_ent_value(get_Sel_ptr(ptr), &entry); } else if (is_Add(ptr)) { - ir_node *l = get_Add_left(ptr); - ir_node *r = get_Add_right(ptr); - ir_mode *mode; + ir_mode *mode; unsigned pos; - if (is_Const(r)) { - ptr = l; - tv = get_Const_tarval(r); - } else { - ptr = r; - tv = get_Const_tarval(l); + { + ir_node *l = get_Add_left(ptr); + ir_node *r = get_Add_right(ptr); + if (is_Const(r)) { + ptr = l; + tv = get_Const_tarval(r); + } else { + ptr = r; + tv = get_Const_tarval(l); + } } ptr_arith: mode = get_tarval_mode(tv); @@ -917,10 +921,10 @@ ptr_arith: /* fill them up */ pos = 0; for (ent = field;;) { - unsigned size; - tarval *sz, *tv_index, *tlower, *tupper; - long index; - ir_node *bound; + unsigned size; + ir_tarval *sz, *tv_index, *tlower, *tupper; + long index; + ir_node *bound; tp = get_entity_type(ent); if (! is_Array_type(tp))