Am Freitag, den 26.11.2021, 09:29 +0100 schrieb Eric Botcazou:
> > This is a silent and dangerous incorrect code generation issue.
> 
> Let's avoid this kind of FUD, please, builtins are low-level devices and 
> people must know what they are doing and be prepared for caveats.

Sorry, I do not think this FUD. One needs to look at the assembly
and know *very specific* details about the platform and atomics
to understand that it does not work and silently (!) breaks on
GCC (and not clang) in very rare cases. This with no indication
about this in the documentation which clearly implies that
this works for "all types".

> > If these functions are not meant to be used to exising
> > data,  then at least the documentation needs to be changed
> > and include a big warning that this only happens to work
> > corectly if the data has  sufficient alignment for the
> > specific architecture (which of course makes it impossible
> > to use this in a portable way).
> 
> The last part of the sentence is again a blatant overstatement

Then please explain how one is supposed to use in a portable way if
it sometimes work or not based on platform-specific alignment
properties. 

>  but I agree 
> that the alignment caveat ought to be documented.  Please suggest a wording 
> to 
> that effect and post a patch onto the gcc-patches@ ML.  Thanks in advance.


Martin

Reply via email to