This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Default to -fstrict-volatile-bitfields for ARM EABI
On Fri, 3 Sep 2010, Jie Zhang wrote:
> However, this warning is correct at least for ARM EABI in someway. The
> "Procedure Call Standard for the ARM Architecture" says (7.1.5:
>
> [quote]
> A volatile qualification on a structure or union shall be interpreted as
> applying the qualification recursively to each of the fundamental data types
> of which it is composed. Access to a volatile-qualified fundamental data type
> must always be made by accessing the whole type.
> [/quote]
>
> So in 20010815-2.c, a->b should be accessed using 32-bit load/store
> instruction. But a->b is not aligned on 32-bit because the struct is packed.
But the above is a description of an ABI for ISO C, where that issue does
not arise. For GNU C, where packed structures are permitted, clearly
being packed should take precedence over being volatile here so that GNU C
programs are properly portable across different architectures.
--
Joseph S. Myers
joseph@codesourcery.com