Work around conservative optimization

Johan Engelen j at j.nl
Mon Jun 4 17:00:53 UTC 2018


On Monday, 4 June 2018 at 08:48:42 UTC, Kagamin wrote:
> On Saturday, 2 June 2018 at 11:44:40 UTC, Johan Engelen wrote:
>> LLVM is not yet smart enough to optimize adjacent stores
>
> I thought it tries to account for memory access errors: 
> depending on how the processor checks memory access the first 
> bytes might not be stored.

Invalid accesses do not need to be taken into account, because 
they are UB. So it is perfectly legal to combine the stores. LLVM 
does do that in some cases, just not in this particular case.  
(GCC does optimize it well btw)

- Johan



More information about the digitalmars-d-ldc mailing list