Commit c21ca196 by Anatoly Sokolov Committed by Anatoly Sokolov

avr.c (initial_elimination_offset): Rename to avr_initial_elimination_offset.

	* config/avr/avr.c (initial_elimination_offset): Rename to
	avr_initial_elimination_offset.
	(frame_pointer_required_p): Rename to avr_frame_pointer_required_p,
	change return type to bool.
	(avr_can_eliminate): New function.
	* config/avr/avr.h (CAN_ELIMINATE): Use avr_can_eliminate.
	(FRAME_POINTER_REQUIRED): Use avr_frame_pointer_required_p.
	(INITIAL_ELIMINATION_OFFSET): Use avr_initial_elimination_offset.
	* config/avr/avr-protos.h (initial_elimination_offset) : Rename to
	avr_initial_elimination_offset.
	(frame_pointer_required_p): Rename to avr_frame_pointer_required_p.
	(avr_initial_elimination_offset): Define.

From-SVN: r146989
parent 2a34bece
2009-04-29 Anatoly Sokolov <aesok@post.ru>
* config/avr/avr.c (initial_elimination_offset): Rename to
avr_initial_elimination_offset.
(frame_pointer_required_p): Rename to avr_frame_pointer_required_p,
change return type to bool.
(avr_can_eliminate): New function.
* config/avr/avr.h (CAN_ELIMINATE): Use avr_can_eliminate.
(FRAME_POINTER_REQUIRED): Use avr_frame_pointer_required_p.
(INITIAL_ELIMINATION_OFFSET): Use avr_initial_elimination_offset.
* config/avr/avr-protos.h (initial_elimination_offset) : Rename to
avr_initial_elimination_offset.
(frame_pointer_required_p): Rename to avr_frame_pointer_required_p.
(avr_initial_elimination_offset): Define.
2009-04-29 Eric Botcazou <ebotcazou@adacore.com>
Steven Bosscher <steven@gcc.gnu.org>
......
......@@ -30,11 +30,12 @@ extern int avr_ret_register (void);
extern enum reg_class class_likely_spilled_p (int c);
extern enum reg_class avr_regno_reg_class (int r);
extern enum reg_class avr_reg_class_from_letter (int c);
extern int frame_pointer_required_p (void);
extern int avr_frame_pointer_required_p (void);
extern void asm_globalize_label (FILE *file, const char *name);
extern void avr_asm_declare_function_name (FILE *, const char *, tree);
extern void order_regs_for_local_alloc (void);
extern int initial_elimination_offset (int from, int to);
extern bool avr_can_eliminate (int, int);
extern int avr_initial_elimination_offset (int from, int to);
extern int avr_simple_epilogue (void);
extern void gas_output_limited_string (FILE *file, const char *str);
extern void gas_output_ascii (FILE *file, const char *str, size_t length);
......
......@@ -545,10 +545,21 @@ avr_regs_to_save (HARD_REG_SET *set)
return count;
}
/* Return true if register FROM can be eliminated via register TO. */
bool
avr_can_eliminate (int from, int to)
{
return ((from == ARG_POINTER_REGNUM && to == FRAME_POINTER_REGNUM)
|| ((from == FRAME_POINTER_REGNUM
|| from == FRAME_POINTER_REGNUM + 1)
&& !frame_pointer_needed));
}
/* Compute offset between arg_pointer and frame_pointer. */
int
initial_elimination_offset (int from, int to)
avr_initial_elimination_offset (int from, int to)
{
if (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
return 0;
......@@ -2843,8 +2854,8 @@ out_movhi_mr_r (rtx insn, rtx op[], int *l)
/* Return 1 if frame pointer for current function required. */
int
frame_pointer_required_p (void)
bool
avr_frame_pointer_required_p (void)
{
return (cfun->calls_alloca
|| crtl->args.info.nregs == 0
......
......@@ -350,7 +350,7 @@ enum reg_class {
#define STATIC_CHAIN_REGNUM 2
#define FRAME_POINTER_REQUIRED frame_pointer_required_p()
#define FRAME_POINTER_REQUIRED avr_frame_pointer_required_p()
/* Offset from the frame pointer register value to the top of the stack. */
#define FRAME_POINTER_CFA_OFFSET(FNDECL) 0
......@@ -360,15 +360,10 @@ enum reg_class {
{FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM} \
,{FRAME_POINTER_REGNUM+1,STACK_POINTER_REGNUM+1}}
#define CAN_ELIMINATE(FROM, TO) (((FROM) == ARG_POINTER_REGNUM \
&& (TO) == FRAME_POINTER_REGNUM) \
|| (((FROM) == FRAME_POINTER_REGNUM \
|| (FROM) == FRAME_POINTER_REGNUM+1) \
&& ! FRAME_POINTER_REQUIRED \
))
#define CAN_ELIMINATE(FROM, TO) avr_can_eliminate (FROM, TO)
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
OFFSET = initial_elimination_offset (FROM, TO)
OFFSET = avr_initial_elimination_offset (FROM, TO)
#define RETURN_ADDR_RTX(count, x) \
gen_rtx_MEM (Pmode, memory_address (Pmode, plus_constant (tem, 1)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment