[PATCH] libstdc++: Clear padding bits in atomic compare_exchange

Jakub Jelinek jakub@redhat.com
Wed Sep 29 12:28:19 GMT 2021


On Wed, Sep 29, 2021 at 01:13:46PM +0100, Jonathan Wakely via Gcc-patches wrote:
> But I think that's OK, as I think the built-in is
> smart enough to be a no-op for types with no padding.

Yes.  The only effect it will have is that during the initial optimization
passes the variable/parameter will be addressable where without the call and
__addressof it wouldn't be; but as soon as __builtin_clear_padding is folded
to nothing if there is no padding or something if there is (which happens
quite early) and TODO_update_address_taken is done at the end
of some pass, it will no longer be addressable (unless something different
keeps taking its address).

	Jakub



More information about the Libstdc++ mailing list