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: Bernd Edlinger <bernd dot edlinger at hotmail dot de>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, Richard Earnshaw <rearnsha at arm dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "sandra at codesourcery dot com" <sandra at codesourcery dot com>, "dj at redhat dot com" <dj at redhat dot com>
- Date: Wed, 4 Sep 2013 10:15:22 +0200
- Subject: RE: [patch 4/4] -fstrict-volatile-bitfields cleanup v3: remove from defaults on all targets
- Authentication-results: sourceware.org; auth=none
- References: <DUB122-W35943644A5D83EC2CAFDB7E4370 at phx dot gbl>,<52245D01 dot 1030702 at arm dot com>,<Pine dot LNX dot 4 dot 64 dot 1309021600390 dot 17654 at digraph dot polyomino dot org dot uk>,<CAFiYyc0he723Zn7jhpXxZCuhL+=KkmDU5FWHvjDpC4juJcsvvg at mail dot gmail dot com>,<DUB122-W24F7F5549EDAC48D8889B0E4310 at phx dot gbl>,<Pine dot LNX dot 4 dot 64 dot 1309032118460 dot 27960 at digraph dot polyomino dot org dot uk>
On Tue, 3 Sep 2013 21:20:04, Joseph S. Myers wrote:
> On Tue, 3 Sep 2013, Bernd Edlinger wrote:
>>>> The trouble is that AAPCS semantics are incompatible with the default GNU
>>>> semantics for non-packed structures as well - AAPCS
>>>> strict-volatile-bitfields is only compatible with --param
>>>> allow-store-data-races=1, which is not the default for any language
>>>> variant accepted by GCC (and I say that the default language semantics
>>>> here should not depend on the target architecture).
>>> As I said it should be easy to fulfil AAPCS requirements if they do not violate
>>> language constrains during code generation and thus warn about accesses
>>> that are emitted in a way not conforming to AAPCS (a warning at struct
>>> declaration time would be nicer, but I guess requires more coding and thought,
>>> though at the point we compute DECL_BIT_FIELD_REPRESENTATIVE in
>>> stor-layout.c would be a suitable place).
>> Just to make that clear, Sandra's patch tries to follow the AAPCS requirements,
>> _even if_ they violate the language constraints.
>> Thus -fstrict-volatile-bitfields implies --param allow-store-data-races=1.
> And my concern is specifically about the defaults - the default for ARM
> should be the same C/C++ language as on other targets - rather than what
> happens if someone specifies -fstrict-volatile-bitfields explicitly.
I fully agree with you, the current default state of -fstrict-volatile-bitfields
should be disabled for all targets. That will be changed in part 4 of Sandra's patch.
For portability of application code, the default should be always off, unless
Even driver code rarely uses bit-fields for register access, because that is
inherently non-portabe. Reason: the bit positions are completely different
on little- and big-endian targets. Most drivers I have seen use some macros
and explicit bit operations for register accesses.
> Joseph S. Myers