On 11/21/2013 05:46 PM, Andrew MacLeod wrote:
I'd like to check in this code from the C11 branch so that it is
present in 4.9.
Its adds a target hook which can be used to override the default
alignment of an atomic type when used with C11's _Atomic qualifier.
There are a couple of ports which have stricter alignment requirements
for an atomic operation than the natural alignment of the integral
type. Today they are just broken with no real facility to repair it.
If this hook is not utilized by a port, the code is transparent and
should therefore be harmless in the code base. It will enable the
ports that care to experiment with changing alignment and see if their
current problems can be resolved for C11.... and then we can look to
push that into C++11 atomic templates somehow. It will also allow
them to flush out any remaining problems that show up with the
fundamental base code which enables it that went in as part of C11.
Bootstraps on x86-64 and currently running regression tests. Assuming
everything passes, OK for mainline?
I wont actually check it in until HP reports back that it actually is
useful to him, I just want to submit it before stage 1 ends :-).
Andrew
H-P reports back that it solves the issues for CRIS :
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg02774.html
So I'd like to put it in. It would be nice to enable this for the type
within the C++11 atomic template too, but Im not sure there is an easy
way short of a new __attribute__((atomic)) or something like that...
Andrew