News for hackers. Stuff that matters.
Re:Modern C (2019) by Jtsummers on Friday June 02, 2023 @02:14PM (#36168784)
The UB permits the optimization, but is not necessary for it. If a language had a stricter definition of pointer and memory access behavior then the optimization would still be applicable if it conformed to the assumption that people are making around the UB in C.

UB is not necessary for optimization, it just permits some optimizations which may or may not be valid and may or may not be consistent across compilers and platforms because people get to fill in the gaps with whatever they want.

There are no comments on this comment yet.