News for hackers. Stuff that matters.
Re:On the Madness of Optimizing Compilers by pjmlp on Tuesday March 08, 2016 @07:21AM (#11244807)
> They can do that all they like as long as the binary still works in all the same situations. Fine by me. I even gave the compiler permission to do it with the -O flags.

If we are talking about C and C++, the binary doesn't have to work according to the UB rules.

> Or are you trying to dictate what compiler writers should be focusing on? They're free to choose what to work on, so don't use their compiler if you disagree with it

Hence why I never code in C unless there isn't any option, and avoid C style code as much as possible when using C++.

Re:On the Madness of Optimizing Compilers by joosters on Tuesday March 08, 2016 @08:17AM (#11244987)
If your program includes undefined behaviour, the compiler cannot magically make your code work, optimisation or not. At best, it can guess what you meant, but guessing is impossible to get completely right. The only way out is to fix your code.
Re:On the Madness of Optimizing Compilers by pjmlp on Tuesday March 08, 2016 @08:38AM (#11245094)
I was talking of UB being an open door to break applications, given that the standard allows for "anything goes" in terms of code generation.

I bet very few C developers, less than 1% outside ISO tables and compiler vendor teams, know ANSI C from cover-to-cover and are able to write UB free code when one sticks to the letter of the standard.