- // if(env->call->flags.bits.call_has_imm && get_irn_opcode());
- low_call = be_new_Call(irg, bl, curr_mem, curr_sp, get_Call_ptr(irn), curr_res_proj, n_low_args, in);
+ if(env->call->flags.bits.call_has_imm && get_irn_opcode(call_ptr) == iro_SymConst) {
+ low_call = be_new_Call(irg, bl, curr_mem, curr_sp, curr_sp, curr_res_proj, n_low_args, in);
+ be_Call_set_entity(low_call, get_SymConst_entity(call_ptr));
+ }
+
+ else
+ low_call = be_new_Call(irg, bl, curr_mem, curr_sp, call_ptr, curr_res_proj, n_low_args, in);
+
+ /* Set the register classes and constraints of the Call parameters. */
+ for(i = 0; i < n_low_args; ++i) {
+ int index = low_args[i];
+ be_abi_call_arg_t *arg = get_call_arg(call, 0, index);
+ assert(arg->reg != NULL);
+ be_set_constr_single_reg(low_call, index, arg->reg);
+ }
+
+ /* Set the register constraints of the results. */
+ for(i = 0; res_projs[i]; ++i) {
+ ir_node *irn = res_projs[i];
+ int proj = get_Proj_proj(irn);
+
+ /* Correct Proj number since it has been adjusted! (see above) */
+ const be_abi_call_arg_t *arg = get_call_arg(call, 1, proj - pn_Call_max);
+
+ assert(arg->in_reg);
+ be_set_constr_single_reg(low_call, BE_OUT_POS(proj), arg->reg);
+ }