* Creates a possible DAG for a constant.
*/
static ir_node *create_const_graph_value(dbg_info *dbgi, ir_node *block,
- long value)
+ long value)
{
ir_node *result;
return proj;
}
+ /* use the 0 register instead of a 0-constant */
+ if (is_Const_null(node)) {
+ return be_prolog_get_reg_value(abihelper, &sparc_gp_regs[REG_G0]);
+ }
+
return create_const_graph(node, block);
}
/* stackpointer is important at function prolog */
be_prolog_add_reg(abihelper, sp_reg,
arch_register_req_type_produces_sp | arch_register_req_type_ignore);
+ be_prolog_add_reg(abihelper, &sparc_gp_regs[REG_G0],
+ arch_register_req_type_ignore);
/* function parameters in registers */
for (i = 0; i < get_method_n_params(function_type); ++i) {
const reg_or_stackslot_t *param = &cconv->parameters[i];