X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Flower%2Flower_calls.c;h=7f15ee5ffe786adc133941e3d5cc9f3b2f82f7b3;hb=aa5c48c22eb13b5c64a340fe8dca931d4bedd1e7;hp=6f71e0f9068bb19ba36574ea0102200e013c374a;hpb=9d564d6198d8a1e36a3a9c9ec9ca4d13c6acd153;p=libfirm diff --git a/ir/lower/lower_calls.c b/ir/lower/lower_calls.c index 6f71e0f90..7f15ee5ff 100644 --- a/ir/lower/lower_calls.c +++ b/ir/lower/lower_calls.c @@ -48,7 +48,7 @@ static pmap *type_map; * Default implementation for finding a pointer type for a given element type. * Simple create a new one. */ -static ir_type *def_find_pointer_type(ir_type *e_type, int alignment) +static ir_type *def_find_pointer_type(ir_type *e_type, ir_mode *mode, int alignment) { ir_type *res; pmap_entry *e; @@ -56,10 +56,11 @@ static ir_type *def_find_pointer_type(ir_type *e_type, int alignment) /* Mode and alignment are always identical in all calls to def_find_pointer_type(), so we simply can use a map from the element type to the pointer type. */ e = pmap_find(type_map, e_type); - if (e) + if (e && get_type_mode(e->value) == mode) res = e->value; else { res = new_type_pointer(e_type); + set_type_mode(res, mode); set_type_alignment_bytes(res, alignment); pmap_insert(type_map, e_type, res); } @@ -129,7 +130,7 @@ static ir_type *create_modified_mtd_type(const lower_params_t *lp, ir_type *mtp) else { /* this compound will be allocated on callers stack and its address will be transmitted as a hidden parameter. */ - ptr_tp = lp->find_pointer_type(res_tp, lp->def_ptr_alignment); + ptr_tp = lp->find_pointer_type(res_tp, get_modeP_data(), lp->def_ptr_alignment); params[nn_params] = ptr_tp; param_map[nn_params] = -1 - i; ++nn_params; @@ -164,7 +165,7 @@ static ir_type *create_modified_mtd_type(const lower_params_t *lp, ir_type *mtp) res_tp = get_method_res_type(mtp, i); if (is_compound_type(res_tp)) { - params[nn_params] = lp->find_pointer_type(res_tp, lp->def_ptr_alignment); + params[nn_params] = lp->find_pointer_type(res_tp, get_modeP_data(), lp->def_ptr_alignment); param_map[nn_params] = -1 - i; ++nn_params; } else {