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/targhooks.c | |
parent | 3686849050cfe9e28fee36c7785f70ee9d4e491c (diff) | |
download | ppe42-gcc-5f458503731f4a23c7c674adebf7c4185e26579c.tar.gz ppe42-gcc-5f458503731f4a23c7c674adebf7c4185e26579c.zip |
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/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 45942a27a22..f33704b0101 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" |