diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2012-08-17 15:50:44 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2012-08-17 08:50:44 -0700 |
commit | d9886a9e04caf0bd1e9147d95af2ea8350ad8e1c (patch) | |
tree | 96cde03a3099b4fe12c7701de5fb3531c7063b6b /gcc/stor-layout.c | |
parent | 4a8f7546197fedb2f4cfa5383c7c185b20b6d5a6 (diff) | |
download | gcc-d9886a9e04caf0bd1e9147d95af2ea8350ad8e1c.zip gcc-d9886a9e04caf0bd1e9147d95af2ea8350ad8e1c.tar.gz gcc-d9886a9e04caf0bd1e9147d95af2ea8350ad8e1c.tar.bz2 |
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.
From-SVN: r190488
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r-- | gcc/stor-layout.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 53554a9..0f55594 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -1627,13 +1627,10 @@ compute_record_mode (tree type) if (simple_cst_equal (TYPE_SIZE (type), DECL_SIZE (field))) mode = DECL_MODE (field); -#ifdef MEMBER_TYPE_FORCES_BLK - /* With some targets, eg. c4x, it is sub-optimal - to access an aligned BLKmode structure as a scalar. */ - - if (MEMBER_TYPE_FORCES_BLK (field, mode)) + /* With some targets, it is sub-optimal to access an aligned + BLKmode structure as a scalar. */ + if (targetm.member_type_forces_blk (field, mode)) return; -#endif /* MEMBER_TYPE_FORCES_BLK */ } /* If we only have one real field; use its mode if that mode's size @@ -2270,9 +2267,7 @@ layout_type (tree type) TYPE_USER_ALIGN (type) = TYPE_USER_ALIGN (element); SET_TYPE_MODE (type, BLKmode); if (TYPE_SIZE (type) != 0 -#ifdef MEMBER_TYPE_FORCES_BLK - && ! MEMBER_TYPE_FORCES_BLK (type, VOIDmode) -#endif + && ! targetm.member_type_forces_blk (type, VOIDmode) /* BLKmode elements force BLKmode aggregate; else extract/store fields may lose. */ && (TYPE_MODE (TREE_TYPE (type)) != BLKmode |