+2016-11-29 Chen Gang <gang.chen.5i5j@gmail.com>
+
+ PR target/71331
+ * config/tilegx/tilegx.c (tilegx_function_profiler): Save r10
+ to stack before call mcount.
+ (tilegx_can_use_return_insn_p): Clean up code.
+
2016-11-29 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
* config/avr/avr-arch.h (avr_mcu_t): Add flash_size member.
tilegx_can_use_return_insn_p (void)
{
return (reload_completed
- && cfun->static_chain_decl == 0
- && compute_total_frame_size () == 0
+ && !cfun->static_chain_decl
+ && !compute_total_frame_size ()
&& tilegx_current_function_is_leaf ()
&& !crtl->profile && !df_regs_ever_live_p (TILEGX_LINK_REGNUM));
}
fprintf (file, "\t}\n");
}
+ if (cfun->static_chain_decl)
+ {
+ fprintf (file,
+ "\t{\n"
+ "\taddi\tsp, sp, -16\n"
+ "\tst\tsp, r10\n"
+ "\t}\n");
+ }
+
if (flag_pic)
{
fprintf (file,
"\t}\n", MCOUNT_NAME);
}
+ if (cfun->static_chain_decl)
+ {
+ fprintf (file,
+ "\taddi\tsp, sp, 16\n"
+ "\tld\tr10, sp\n");
+ }
+
tilegx_in_bundle = false;
}