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/targhooks.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/targhooks.c')
-rw-r--r-- | gcc/targhooks.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 45942a2..f33704b 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -572,4 +572,18 @@ default_secondary_reload (bool in_p ATTRIBUTE_UNUSED, rtx x ATTRIBUTE_UNUSED, return class; } + +/* If STRICT_ALIGNMENT is true we use the container type for accessing + volatile bitfields. This is generally the preferred behavior for memory + mapped peripherals on RISC architectures. + If STRICT_ALIGNMENT is false we use the narrowest type possible. This + is typically used to avoid spurious page faults and extra memory accesses + due to unaligned accesses on CISC architectures. */ + +bool +default_narrow_bitfield (void) +{ + return !STRICT_ALIGNMENT; +} + #include "gt-targhooks.h" |