diff options
author | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-08-17 15:50:44 +0000 |
---|---|---|
committer | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-08-17 15:50:44 +0000 |
commit | f91ed644dd9a0394f268eb3410ee3a17bb439a1c (patch) | |
tree | 96cde03a3099b4fe12c7701de5fb3531c7063b6b /gcc/config/xtensa | |
parent | 4b9beb88f5d49452a1fb25826c00cd81b7461b04 (diff) | |
download | gcc-f91ed644dd9a0394f268eb3410ee3a17bb439a1c.tar.gz |
Convert MEMBER_TYPE_FORCES_BLK to target hook
* stor-layout.c (compute_record_mode): Replace
MEMBER_TYPE_FORCES_BLK with targetm.member_type_forces_blk.
(layout_type): Likewise.
* system.h: Poison MEMBER_TYPE_FORCES_BLK.
* target.def (member_type_forces_blk): New target hook.
* targhooks.c (default_member_type_forces_blk): New.
* targhooks.h (default_member_type_forces_blk): Likewise.
* doc/tm.texi.in (MEMBER_TYPE_FORCES_BLK): Removed.
(TARGET_MEMBER_TYPE_FORCES_BLK): New hook.
* doc/tm.texi: Regenerated.
* config/ia64/hpux.h (MEMBER_TYPE_FORCES_BLK): Removed.
* config/ia64/ia64.c (ia64_member_type_forces_blk): New
function.
(TARGET_MEMBER_TYPE_FORCES_BLK): New macro.
* config/rs6000/rs6000.c (TARGET_MEMBER_TYPE_FORCES_BLK): New
macro.
(rs6000_member_type_forces_blk): New function.
* config/rs6000/rs6000.h (MEMBER_TYPE_FORCES_BLK): Removed.
* config/xtensa/xtensa.c (xtensa_member_type_forces_blk): New
function.
(TARGET_MEMBER_TYPE_FORCES_BLK): New macro.
* config/xtensa/xtensa.h (MEMBER_TYPE_FORCES_BLK): Removed.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190488 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/xtensa')
-rw-r--r-- | gcc/config/xtensa/xtensa.c | 18 | ||||
-rw-r--r-- | gcc/config/xtensa/xtensa.h | 9 |
2 files changed, 18 insertions, 9 deletions
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index fa38008bb0b..6fbb3f6fe31 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -175,6 +175,9 @@ static reg_class_t xtensa_secondary_reload (bool, rtx, reg_class_t, static bool constantpool_address_p (const_rtx addr); static bool xtensa_legitimate_constant_p (enum machine_mode, rtx); +static bool xtensa_member_type_forces_blk (const_tree, + enum machine_mode mode); + static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] = REG_ALLOC_ORDER; @@ -210,6 +213,9 @@ static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] = #undef TARGET_ADDRESS_COST #define TARGET_ADDRESS_COST hook_int_rtx_bool_0 +#undef TARGET_MEMBER_TYPE_FORCES_BLK +#define TARGET_MEMBER_TYPE_FORCES_BLK xtensa_member_type_forces_blk + #undef TARGET_BUILD_BUILTIN_VA_LIST #define TARGET_BUILD_BUILTIN_VA_LIST xtensa_build_builtin_va_list @@ -2738,6 +2744,18 @@ xtensa_return_addr (int count, rtx frame) return result; } +/* Disable the use of word-sized or smaller complex modes for structures, + and for function arguments in particular, where they cause problems with + register a7. The xtensa_copy_incoming_a7 function assumes that there is + a single reference to an argument in a7, but with small complex modes the + real and imaginary components may be extracted separately, leading to two + uses of the register, only one of which would be replaced. */ + +static bool +xtensa_member_type_forces_blk (const_tree, enum machine_mode mode) +{ + return mode == CQImode || mode == CHImode; +} /* Create the va_list data type. diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h index b1a24c6d86d..50e221a130f 100644 --- a/gcc/config/xtensa/xtensa.h +++ b/gcc/config/xtensa/xtensa.h @@ -165,15 +165,6 @@ extern unsigned xtensa_current_frame_size; bitfields and the structures that contain them. */ #define PCC_BITFIELD_TYPE_MATTERS 1 -/* Disable the use of word-sized or smaller complex modes for structures, - and for function arguments in particular, where they cause problems with - register a7. The xtensa_copy_incoming_a7 function assumes that there is - a single reference to an argument in a7, but with small complex modes the - real and imaginary components may be extracted separately, leading to two - uses of the register, only one of which would be replaced. */ -#define MEMBER_TYPE_FORCES_BLK(FIELD, MODE) \ - ((MODE) == CQImode || (MODE) == CHImode) - /* Align string constants and constructors to at least a word boundary. The typical use of this macro is to increase alignment for string constants to be word aligned so that 'strcpy' calls that copy |