This is the mail archive of the
mailing list for the GCC project.
Re: [patch 4/4] -fstrict-volatile-bitfields cleanup v3: remove from defaults on all targets
- From: DJ Delorie <dj at redhat dot com>
- To: Sandra Loosemore <sandra at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 2 Jul 2013 13:33:46 -0400
- Subject: Re: [patch 4/4] -fstrict-volatile-bitfields cleanup v3: remove from defaults on all targets
- References: <51D0F6A0 dot 4010307 at codesourcery dot com> <201307010332 dot r613WeJJ017250 at greed dot delorie dot com> <51D1992F dot 1090108 at codesourcery dot com>
> The choice appears to be to continue to have broken volatile bitfields
> on ARM with no way for users to make them conform to the ABI, or to
> change things so that they conform to the ABI if you specify
> -fstrict-volatile-bitfields explicitly and to the C/C++ standard by
> default, without that option.
I can't speak for ARM, but for the other targets (for which I wrote
the original patch), the requirement is that volatile bitfield
accesses ALWAYS be in the mode of the type specified by the user. If
the user says "int x:8;" then SImode (assuming 32-bit ints) must
always be used, even if QImode could be used.
The reason for this is that volatile bitfields are normally used for
memory-mapped peripherals, and accessing peripheral registers in the
wrong mode leads to incorrect operation.