PR target/1679.
* config/m32r/m32r.c (m32r_function_symbol): New function: Generate a symbol
name RTX with the correct m32r specific flags set.
(block_move_call): Use new function to generate correct symbol.
* config/m32r/m32r-protos.h: Add prototype for new funcion.
* config/m32r/m32r.h (INITIALIZE_TRAMPOLINE): Use the new function.
From-SVN: r84200
+2004-07-06 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
+
+ PR target/1679.
+ * config/m32r/m32r.c (m32r_function_symbol): New function:
+ Generate a symbol name RTX with the correct m32r specific flags
+ set.
+ (block_move_call): Use new function to generate correct symbol.
+ * config/m32r/m32r-protos.h: Add prototype for new funcion.
+ * config/m32r/m32r.h (INITIALIZE_TRAMPOLINE): Use the new
+ function.
+
2004-07-07 Nathan Sidwell <nathan@codesourcery.com>
* tree.h (TYPE_BINFO_OFFSET, TYPE_BINFO_VTABLE,
extern int m32r_legitimate_pic_operand_p (rtx);
extern rtx m32r_legitimize_pic_address (rtx, rtx);
extern rtx m32r_return_addr (int);
+extern rtx m32r_function_symbol (const char *);
#ifdef HAVE_MACHINE_MODES
extern int call_address_operand (rtx, Mmode);
}
\f
+rtx
+m32r_function_symbol (const char *name)
+{
+ int extra_flags = 0;
+ enum m32r_model model;
+ rtx sym = gen_rtx_SYMBOL_REF (Pmode, name);
+
+ if (TARGET_MODEL_SMALL)
+ model = M32R_MODEL_SMALL;
+ else if (TARGET_MODEL_MEDIUM)
+ model = M32R_MODEL_MEDIUM;
+ else if (TARGET_MODEL_LARGE)
+ model = M32R_MODEL_LARGE;
+ else
+ abort (); /* Shouldn't happen. */
+ extra_flags |= model << SYMBOL_FLAG_MODEL_SHIFT;
+
+ if (extra_flags)
+ SYMBOL_REF_FLAGS (sym) |= extra_flags;
+
+ return sym;
+}
+
/* Use a library function to move some bytes. */
static void
&& GET_MODE (bytes_rtx) != Pmode)
bytes_rtx = convert_to_mode (Pmode, bytes_rtx, 1);
- emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "memcpy"), 0,
+ emit_library_call (m32r_function_symbol ("memcpy"), 0,
VOIDmode, 3, dest_reg, Pmode, src_reg, Pmode,
convert_to_mode (TYPE_MODE (sizetype), bytes_rtx,
TYPE_UNSIGNED (sizetype)),
emit_insn (gen_flush_icache (validize_mem (gen_rtx_MEM (SImode, TRAMP)),\
GEN_INT (m32r_cache_flush_trap) )); \
else if (m32r_cache_flush_func && m32r_cache_flush_func[0]) \
- emit_library_call (gen_rtx_SYMBOL_REF (Pmode, m32r_cache_flush_func), \
+ emit_library_call (m32r_function_symbol (m32r_cache_flush_func), \
0, VOIDmode, 3, TRAMP, Pmode, \
GEN_INT (TRAMPOLINE_SIZE), SImode, \
GEN_INT (3), SImode); \