On Mon, Sep 30, 2024 at 11:42:11AM +0200, Jonas Oberhauser wrote:
I also currently don't see any major difference between the constant and
register case. The point is that the address is known before loading into b,
and hence the compiler + hardware can speculatively load *b before loading
into b.
In theory, true. In practice, in the register case, you need a little
more bad luck for the compiler to be able to exploit your mistake.