4 ms·
>The point of giving that example is to show that there are studies that examine the benefit of undefined behavior, Of course, that is exactly what Regehr's pa
by vyodaiken 8y ago
>The point of giving that example is to show that there are studies that examine the benefit of undefined behavior,
Of course, that is exactly what Regehr's paper does not show. It shows that a modification of Clang/LVM UB operations has some good properties. I am asking for studies showing significant benefits for UB "optimizations" that are not available otherwise.
I never advocated eliminating undefined behavior from C, I advocate eliminating UB based "optimizations" from C compilers, particularly "optimizations" which rely on assuming code will never do what emitted code does!
>The reason why you don't see any studies on it is that it's obvious.
And that is the classic tell for a serious mistake in engineering. We don't need to study it, its obvious.
Your response is flat out wrong. C is not defined as a memory safe language. You are inventing a false dichotomy: if the compiler cannot assume UB never happens, it must ensure UB never happens. Nope.
- pcwalton 8y ago> I never advocated eliminating undefined behavior from C, I advocate eliminating UB based "optimizations" from C compilers, particularly "optimizations" which rely on assuming code will never do what emitted code does! OK, then that definition excludes register allocation as a permitted optimization. If you want to compile C code without any exploitation of undefined behavior, that's readily available! Just pass -O0 to your compiler.
- vyodaiken 8y ago>OK, then that definition excludes register allocation as a permitted optimization Oh come on.
- deleted 8y ago[deleted]