Skip to content

Comment on The strict aliasing situation is pretty bad (2016)parent

Comments

This is behavior is mostly just unspecified, at least for C++ (not sure about C).

I'm aware of some efforts to bring deterministic floating point operations into the C++ standard, but AFAIK there are no publicly available papers yet.

P3375R0 is public now [0], with a couple implementations available [1], [2].

Subexpression combining has more general implications that are usually worked around with gratuitous volatile abuse or magical incantations to construct compiler optimization barriers. Floating point is simply the most straightforward example where it leads to an observable change in behavior.

[0] https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p33...

[1] https://github.com/sixitbb/sixit-dmath

[2] https://github.com/J-Montgomery/rfloat/

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.