This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch 4/4] -fstrict-volatile-bitfields cleanup v3: remove from defaults on all targets


> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]