diff options
author | pbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-03-29 15:21:13 +0000 |
---|---|---|
committer | pbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-03-29 15:21:13 +0000 |
commit | 5f458503731f4a23c7c674adebf7c4185e26579c (patch) | |
tree | 13c3108b931a9f5530ee972b04fc4361a6cff803 /gcc/stor-layout.c | |
parent | 3686849050cfe9e28fee36c7785f70ee9d4e491c (diff) | |
download | gcc-5f458503731f4a23c7c674adebf7c4185e26579c.tar.gz |
2006-03-29 Paul Brook <paul@codesourcery.com>
PR middle-end/23623
* targhooks.c (default_narrow_bitfield): New fuction.
* targhooks.h (default_narrow_bitfield): add prototype.
* target.h (gcc_target): Add narrow_volatile_bitfield.
* target-def.h (TARGET_NARROW_VOLATILE_BITFIELD): Define.
* stor-layout.c (get_best_mode): Use targetm.narrow_volatile_bitfield.
* doc/tm.texi: Document TARGET_NARROW_VOLATILE_BITFIELDS.
* config/arm/arm.c (TARGET_NARROW_VOLATILE_BITFIELD): Define.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112493 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r-- | gcc/stor-layout.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index caf176f49c5..5617d27290e 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -2148,13 +2148,17 @@ fixup_unsigned_type (tree type) If LARGEST_MODE is not VOIDmode, it means that we should not use a mode larger than LARGEST_MODE (usually SImode). - If no mode meets all these conditions, we return VOIDmode. Otherwise, if - VOLATILEP is true or SLOW_BYTE_ACCESS is false, we return the smallest - mode meeting these conditions. - - Otherwise (VOLATILEP is false and SLOW_BYTE_ACCESS is true), we return - the largest mode (but a mode no wider than UNITS_PER_WORD) that meets - all the conditions. */ + If no mode meets all these conditions, we return VOIDmode. + + If VOLATILEP is false and SLOW_BYTE_ACCESS is false, we return the + smallest mode meeting these conditions. + + If VOLATILEP is false and SLOW_BYTE_ACCESS is true, we return the + largest mode (but a mode no wider than UNITS_PER_WORD) that meets + all the conditions. + + If VOLATILEP is true the narrow_volatile_bitfields target hook is used to + decide which of the above modes should be used. */ enum machine_mode get_best_mode (int bitsize, int bitpos, unsigned int align, @@ -2184,7 +2188,8 @@ get_best_mode (int bitsize, int bitpos, unsigned int align, || (largest_mode != VOIDmode && unit > GET_MODE_BITSIZE (largest_mode))) return VOIDmode; - if (SLOW_BYTE_ACCESS && ! volatilep) + if ((SLOW_BYTE_ACCESS && ! volatilep) + || (volatilep && !targetm.narrow_volatile_bitfield())) { enum machine_mode wide_mode = VOIDmode, tmode; |