News for hackers. Stuff that matters.
Re:Aliasing by Ono-Sendai on Monday December 22, 2025 @07:15AM (#46353559)
When you have done enough C++ you don't need to fire up compiler explorer, you just use local variables to avoid aliasing pessimisations.

I also wrote about this a while ago: https://forwardscattering.org/post/51

Re:Aliasing by dataflow on Monday December 22, 2025 @11:53AM (#46355851)
I think this might not be a shortcoming of MSVC but rather a deliberate design decision. It seems likely that MSVC is failing to apply strict aliasing, but that it's deliberately avoiding it, probably for compatibility reasons with code that wasn't/isn't written to spec. And frankly it can be very onerous to write code that is 100% correct per the standard when dealing with e.g. memory-mapped files; I'm struggling to recall seeing a single case of this.
Re:Aliasing by gpderetta on Monday December 22, 2025 @02:48PM (#46358112)
AFIK MSVC has never implemented TBAA by design.
Re:Aliasing by gpvos on Tuesday December 23, 2025 @01:41AM (#46363012)
TBAA = type-based alias analysis