diff options
author | Anatoly Sokolov <aesok@post.ru> | 2009-08-26 01:09:00 +0400 |
---|---|---|
committer | Anatoly Sokolov <aesok@gcc.gnu.org> | 2009-08-26 01:09:00 +0400 |
commit | 7b5cbb57032c98320bc7b5ba9da3dab8362a393d (patch) | |
tree | 44f8c8c44ea173046d301d7e79624a45b2640933 /gcc/config/iq2000 | |
parent | 79232baaf890c7223876b5ffb93ed05e7948d7a3 (diff) | |
download | gcc-7b5cbb57032c98320bc7b5ba9da3dab8362a393d.zip gcc-7b5cbb57032c98320bc7b5ba9da3dab8362a393d.tar.gz gcc-7b5cbb57032c98320bc7b5ba9da3dab8362a393d.tar.bz2 |
hooks.h (hook_bool_const_int_const_int_true): Declare.
* hooks.h (hook_bool_const_int_const_int_true): Declare.
* hooks.c (hook_bool_const_int_const_int_true): New function.
* target.h (struct gcc_target): Add can_eliminate field.
* target-def.h (TARGET_CAN_ELIMINATE): Define.
(TARGET_INITIALIZER): Use TARGET_CAN_ELIMINATE.
* ira.c (setup_eliminable_regset): Use can_eliminate target hook.
* reload1.c (update_eliminables, init_elim_table): (Ditto.).
(elim_table): Revise comment.
* system.h (CAN_ELIMINATE): Poison.
* defaults.h (CAN_ELIMINATE): Remove.
* doc/tm.texi (CAN_ELIMINATE): Revise documentation.
* config/alpha/vms.h (CAN_ELIMINATE): Remove macro.
* config/alpha/alpha.c (TARGET_CAN_ELIMINATE) [TARGET_ABI_OPEN_VMS]:
Define macro.
(alpha_vms_can_eliminate): Declare as static, change return type to
bool.
* config/alpha/alpha-protos.h (alpha_vms_can_eliminate): Remove.
* config/arm/arm.h (CAN_ELIMINATE): Remove macro.
* config/arm/arm.c (TARGET_CAN_ELIMINATE): Define macro.
(arm_can_eliminate): New function.
* config/avr/avr.h (CAN_ELIMINATE): Remove macro.
* config/avr/avr.c (TARGET_CAN_ELIMINATE): Define macro.
(avr_can_eliminate): Declare as static.
* config/avr/avr-protos.h (avr_can_eliminate): Remove.
* config/bfin/bfin.h (CAN_ELIMINATE): Remove macro.
* config/bfin/bfin.c (TARGET_CAN_ELIMINATE): Define macro.
(bfin_can_eliminate): New function.
* config/crx/crx.h (CAN_ELIMINATE): Remove macro.
* config/crx/crx.c (TARGET_CAN_ELIMINATE): Define macro.
(crx_can_eliminate): New function.
* config/fr30/fr30.h (CAN_ELIMINATE): Remove macro.
* config/fr30/fr30.c (TARGET_CAN_ELIMINATE): Define macro.
(fr30_can_eliminate): New function.
* config/frv/frv.h (CAN_ELIMINATE): Remove macro.
* config/frv/frv.c (TARGET_CAN_ELIMINATE): Define macro.
(frv_can_eliminate): New function.
* config/h8300/h8300.h (CAN_ELIMINATE): Remove macro.
* config/h8300/h8300.c (TARGET_CAN_ELIMINATE): Define macro.
(h8300_can_eliminate): New function.
* config/i386/i386.h (CAN_ELIMINATE): Remove macro.
* config/i386/i386.c (TARGET_CAN_ELIMINATE): Define macro.
(i386_can_eliminate): Declare as static, change return type to bool.
* config/i386/i386-protos.h (i386_can_eliminate): Remove.
* config/ia64/ia64.h (CAN_ELIMINATE): Remove macro.
* config/ia64/ia64.c (TARGET_CAN_ELIMINATE): Define macro.
(ia64_can_eliminate): New function.
* config/iq2000/iq2000.h (CAN_ELIMINATE): Remove macro.
* config/iq2000/iq2000.c (TARGET_CAN_ELIMINATE): Define macro.
(iq2000_can_eliminate): New function.
* config/m32r/m32r.h (CAN_ELIMINATE): Remove macro.
* config/m32r/m32r.c (TARGET_CAN_ELIMINATE): Define macro.
(m32r_can_eliminate): New function.
* config/m68hc11/m68hc11.h (CAN_ELIMINATE): Remove macro.
* config/m68hc11/m68hc11.c (TARGET_CAN_ELIMINATE): Define macro.
(m68hc11_can_eliminate): New function.
* config/m68k/m68k.h (CAN_ELIMINATE): Remove macro.
* config/m68k/m68k.c (TARGET_CAN_ELIMINATE): Define macro.
(m68k_can_eliminate): New function.
* config/mep/mep.h (CAN_ELIMINATE): Remove macro.
* config/mep/mep.c (TARGET_CAN_ELIMINATE): Define macro.
(mep_can_eliminate): New function.
* config/mips/mips.h (CAN_ELIMINATE): Remove macro.
* config/mips/mips.c (TARGET_CAN_ELIMINATE): Define macro.
(mips_can_eliminate): New function.
* config/rs6000/rs6000.h (CAN_ELIMINATE): Remove macro.
* config/rs6000/rs6000.c (TARGET_CAN_ELIMINATE): Define macro.
(rs6000_can_eliminate): New function.
* config/s390/s390.h (CAN_ELIMINATE): Remove macro.
* config/s390/s390.c (TARGET_CAN_ELIMINATE): Define macro.
(s390_can_eliminate): Declare as static.
* config/s390/s390-protos.h (sparc_can_eliminate): Remove.
* config/score/score.h (CAN_ELIMINATE): Remove macro.
* config/score/score.c (TARGET_CAN_ELIMINATE): Define macro.
(score_can_eliminate): New function.
* config/sparc/sparc.h (CAN_ELIMINATE): Remove macro.
* config/sparc/sparc.c (TARGET_CAN_ELIMINATE): Define macro.
(sparc_can_eliminate): Declare as static.
* config/sparc/sparc-protos.h (sparc_can_eliminate): Remove.
* config/stormy16/stormy16.h (CAN_ELIMINATE): Remove macro.
* config/stormy16/stormy16.c (TARGET_CAN_ELIMINATE): Define macro.
(xstormy16_can_eliminate): New function.
* config/v850/v850.h (CAN_ELIMINATE): Remove macro.
* config/v850/v850.c (TARGET_CAN_ELIMINATE): Define macro.
(v850_can_eliminate): New function.
From-SVN: r151096
Diffstat (limited to 'gcc/config/iq2000')
-rw-r--r-- | gcc/config/iq2000/iq2000.c | 22 | ||||
-rw-r--r-- | gcc/config/iq2000/iq2000.h | 13 |
2 files changed, 22 insertions, 13 deletions
diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c index ff0c868..85a8e5a 100644 --- a/gcc/config/iq2000/iq2000.c +++ b/gcc/config/iq2000/iq2000.c @@ -1,5 +1,5 @@ /* Subroutines used for code generation on Vitesse IQ2000 processors - Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 + Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of GCC. @@ -165,6 +165,7 @@ static int iq2000_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, tree, bool); static void iq2000_va_start (tree, rtx); static bool iq2000_legitimate_address_p (enum machine_mode, rtx, bool); +static bool iq2000_can_eliminate (const int, const int); #undef TARGET_INIT_BUILTINS #define TARGET_INIT_BUILTINS iq2000_init_builtins @@ -214,6 +215,9 @@ static bool iq2000_legitimate_address_p (enum machine_mode, rtx, bool); #undef TARGET_LEGITIMATE_ADDRESS_P #define TARGET_LEGITIMATE_ADDRESS_P iq2000_legitimate_address_p +#undef TARGET_CAN_ELIMINATE +#define TARGET_CAN_ELIMINATE iq2000_can_eliminate + struct gcc_target targetm = TARGET_INITIALIZER; /* Return nonzero if we split the address into high and low parts. */ @@ -1678,6 +1682,22 @@ compute_frame_size (HOST_WIDE_INT size) return total_size; } + +/* We can always eliminate to the frame pointer. We can eliminate to the + stack pointer unless a frame pointer is needed. */ + +bool +iq2000_can_eliminate (const int from, const int to) +{ + return (from == RETURN_ADDRESS_POINTER_REGNUM + && (! leaf_function_p () + || (to == GP_REG_FIRST + 31 && leaf_function_p))) + || (from != RETURN_ADDRESS_POINTER_REGNUM + && (to == HARD_FRAME_POINTER_REGNUM + || (to == STACK_POINTER_REGNUM + && ! frame_pointer_needed))); +} + /* Implement INITIAL_ELIMINATION_OFFSET. FROM is either the frame pointer, argument pointer, or return address pointer. TO is either the stack pointer or hard frame pointer. */ diff --git a/gcc/config/iq2000/iq2000.h b/gcc/config/iq2000/iq2000.h index c1506a4..43bacfd 100644 --- a/gcc/config/iq2000/iq2000.h +++ b/gcc/config/iq2000/iq2000.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. Vitesse IQ2000 processors - Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 + Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of GCC. @@ -354,17 +354,6 @@ enum reg_class { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}} - -/* We can always eliminate to the frame pointer. We can eliminate to the - stack pointer unless a frame pointer is needed. */ - -#define CAN_ELIMINATE(FROM, TO) \ - (((FROM) == RETURN_ADDRESS_POINTER_REGNUM && (! leaf_function_p () \ - || (TO == GP_REG_FIRST + 31 && leaf_function_p))) \ - || ((FROM) != RETURN_ADDRESS_POINTER_REGNUM \ - && ((TO) == HARD_FRAME_POINTER_REGNUM \ - || ((TO) == STACK_POINTER_REGNUM && ! frame_pointer_needed)))) - #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ (OFFSET) = iq2000_initial_elimination_offset ((FROM), (TO)) |