diff options
author | Paul Brook <paul@codesourcery.com> | 2006-03-29 15:21:13 +0000 |
---|---|---|
committer | Paul Brook <pbrook@gcc.gnu.org> | 2006-03-29 15:21:13 +0000 |
commit | c2a644391b7e8d4603d95e97daabd1b368052421 (patch) | |
tree | 13c3108b931a9f5530ee972b04fc4361a6cff803 /gcc/stor-layout.c | |
parent | 4dc19cc052742f88e118458c6036468d0a9bf7a6 (diff) | |
download | gcc-c2a644391b7e8d4603d95e97daabd1b368052421.zip gcc-c2a644391b7e8d4603d95e97daabd1b368052421.tar.gz gcc-c2a644391b7e8d4603d95e97daabd1b368052421.tar.bz2 |
re PR middle-end/23623 (volatile keyword changes bitfield access size from 32bit to 8bit)
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.
From-SVN: r112493
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 caf176f..5617d27 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; |