patch: honor volatile bitfield types

Mark Mitchell mark@codesourcery.com
Sat Jun 12 02:28:00 GMT 2010


DJ Delorie wrote:

> Ok, updated documentation, and the default value for the flag is -1.
> The checks are all "flag > 0" so it can be left at -1 or changed to
> some other default, but the targets can see if it's still unspecified
> and change it if they wish.

Thanks, both for that and for improving the documentation.

I'm still not very happy with the option name.  I don't think GCC
normally dishonors bitfield types. :-)  But, I guess I can't really
think of something I like a lot better.

I also don't think "strict alignment" is a very oft-used term outside of
GCC's internals.  I'd prefer to explicitly say what that means.

I think these warnings:

> +		warning (0, "mis-aligned access required for structure member");

should mention the fact that the bit-field is volatile and what the
consequences are.  Something like:

  using mis-aligned load to or store from field 'x' of 'struct a'
because multiple aligned loads/stores would be required and the field is
volatile

I think it really needs to be detailed at this level so that people have
some idea what's going on.  And, the field name should definitely be
mentioned if at all possible.

The patch is OK with changes in that spirit.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Gcc-patches mailing list