+2004-06-15 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
+
+ * config/m32r/m32r.h (RETURN_ADDR_RTX): Define.
+ (INCOMING_RETURN_ADDR_RTX): Define.
+ * config/m32r/m32r-protos.h (m32r_return_addr): Added.
+ * config/m32r/m32r.c (m32r_exppand_prologue): Changed for
+ __builtin_return_address(0).
+ (m32r_return_addr): Added for __builtin_return_address(0).
+ (m32r_reload_lr): Ditto.
+
2004-06-15 Paolo Bonzini <bonzini@gnu.org>
* doc/install.texi (Prerequisites): Update libbanshee,
* config/arm/t-xscale-elf: Disable iwmmxt multilibs until they can
be safely built.
-2004-04-16 Kazuhiro Inaoka <inaoka dot kazuhiro at renesas dot com>
+2004-04-16 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
* config/m32r/m32r.h (BIG_ENDIAN_BIT): Deleted to fix endian
bug.
extern int m32r_hard_regno_rename_ok (unsigned int, unsigned int);
extern int m32r_legitimate_pic_operand_p (rtx);
extern rtx m32r_legitimize_pic_address (rtx, rtx);
+extern rtx m32r_return_addr (int);
#ifdef HAVE_MACHINE_MODES
extern int call_address_operand (rtx, Mmode);
/* The table we use to reference PIC data. */
static rtx global_offset_table;
+static void
+m32r_reload_lr (rtx sp, int size)
+{
+ rtx lr = gen_rtx_REG (Pmode, RETURN_ADDR_REGNUM);
+
+ if (size == 0)
+ emit_insn (gen_movsi (lr, gen_rtx_MEM (Pmode, sp)));
+ else if (size <= 32768)
+ emit_insn (gen_movsi (lr, gen_rtx_MEM (Pmode,
+ gen_rtx_PLUS (Pmode, sp,
+ GEN_INT (size)))));
+ else
+ {
+ rtx tmp = gen_rtx_REG (Pmode, PROLOGUE_TMP_REGNUM);
+
+ emit_insn (gen_movsi (tmp, GEN_INT (size)));
+ emit_insn (gen_addsi3 (tmp, tmp, sp));
+ emit_insn (gen_movsi (lr, gen_rtx_MEM (Pmode, tmp)));
+ }
+
+ emit_insn (gen_rtx_USE (VOIDmode, lr));
+}
+
void
m32r_load_pic_register (void)
{
gen_rtx_REG (Pmode, RETURN_ADDR_REGNUM)));
if (pic_reg_used)
- m32r_load_pic_register ();
+ {
+ m32r_load_pic_register ();
+ m32r_reload_lr (stack_pointer_rtx,
+ (current_function_profile ? 0 : frame_size));
+ }
if (current_function_profile && !pic_reg_used)
emit_insn (gen_blockage ());
return 1;
}
+
+rtx
+m32r_return_addr (int count)
+{
+ if (count != 0)
+ return const0_rtx;
+
+ return get_hard_reg_initial_val (Pmode, RETURN_ADDR_REGNUM);
+}
/* Generate calls to memcpy, memcmp and memset. */
#define TARGET_MEM_FUNCTIONS
\f
+#define RETURN_ADDR_RTX(COUNT, FRAME) m32r_return_addr (COUNT)
+
+#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, RETURN_ADDR_REGNUM)
+
/* Addressing modes, and classification of registers for them. */
/* Maximum number of registers that can appear in a valid memory address. */