fix mode of call-result proj
authorMatthias Braun <matze@braunis.de>
Thu, 18 Aug 2011 13:01:44 +0000 (15:01 +0200)
committerMatthias Braun <matze@braunis.de>
Mon, 22 Aug 2011 14:27:36 +0000 (16:27 +0200)
ir/be/sparc/sparc_transform.c

index 4b7a36c..9f5785c 100644 (file)
@@ -2154,12 +2154,14 @@ static ir_node *gen_Proj_Proj_Call(ir_node *node)
        ir_type              *function_type = get_Call_type(call);
        calling_convention_t *cconv
                = sparc_decide_calling_convention(function_type, NULL);
-       const reg_or_stackslot_t  *res = &cconv->results[pn];
-       ir_mode                   *mode;
+       const reg_or_stackslot_t  *res  = &cconv->results[pn];
+       ir_mode                   *mode = get_irn_mode(node);
        long                       new_pn = 1 + res->reg_offset;
 
        assert(res->req0 != NULL && res->req1 == NULL);
-       mode = res->req0->cls->mode;
+       if (mode_needs_gp_reg(mode)) {
+               mode = mode_gp;
+       }
        sparc_free_calling_convention(cconv);
 
        return new_r_Proj(new_call, mode, new_pn);