diff options
author | aesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-08-25 21:09:00 +0000 |
---|---|---|
committer | aesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-08-25 21:09:00 +0000 |
commit | cd90919ddf67bf946228a11ba0cf0c7402dda3fe (patch) | |
tree | 44f8c8c44ea173046d301d7e79624a45b2640933 /gcc/config/h8300 | |
parent | c7a421e25c941e835ae7663f1b0e358d30d37f1d (diff) | |
download | gcc-cd90919ddf67bf946228a11ba0cf0c7402dda3fe.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151096 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/h8300')
-rw-r--r-- | gcc/config/h8300/h8300.c | 17 | ||||
-rw-r--r-- | gcc/config/h8300/h8300.h | 13 |
2 files changed, 18 insertions, 12 deletions
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index c3dd29723fe..02b3ff6094a 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -1825,6 +1825,20 @@ h8300_expand_movsi (rtx operands[]) return 0; } +/* Given FROM and TO register numbers, say whether this elimination is allowed. + Frame pointer elimination is automatically handled. + + For the h8300, if frame pointer elimination is being done, we would like to + convert ap and rp into sp, not fp. + + All other eliminations are valid. */ + +static bool +h8300_can_eliminate (const int from ATTRIBUTE_UNUSED, const int to) +{ + return (to == STACK_POINTER_REGNUM ? ! frame_pointer_needed : true); +} + /* Function for INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET). Define the offset between two registers, one to be eliminated, and the other its replacement, at the start of a routine. */ @@ -5801,4 +5815,7 @@ h8300_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED) #undef TARGET_DEFAULT_TARGET_FLAGS #define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT +#undef TARGET_CAN_ELIMINATE +#define TARGET_CAN_ELIMINATE h8300_can_eliminate + struct gcc_target targetm = TARGET_INITIALIZER; diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h index dd95ed7253d..884e49a9d4a 100644 --- a/gcc/config/h8300/h8300.h +++ b/gcc/config/h8300/h8300.h @@ -1,7 +1,7 @@ /* Definitions of target machine for GNU compiler. Renesas H8/300 (generic) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008 + 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. Contributed by Steve Chamberlain (sac@cygnus.com), Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com). @@ -558,17 +558,6 @@ enum reg_class { { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}} -/* Given FROM and TO register numbers, say whether this elimination is allowed. - Frame pointer elimination is automatically handled. - - For the h8300, if frame pointer elimination is being done, we would like to - convert ap and rp into sp, not fp. - - All other eliminations are valid. */ - -#define CAN_ELIMINATE(FROM, TO) \ - ((TO) == STACK_POINTER_REGNUM ? ! frame_pointer_needed : 1) - /* Define the offset between two registers, one to be eliminated, and the other its replacement, at the start of a routine. */ |