Re:New things in clang land (5.0.0)
by crististm on Thursday December 07, 2017 @07:05AM
(#15869348)
I shiver when I read the kind of replies you get... The ones that defend idiotic compiler behaviour justified by "optimizations"
[ Parent
| on HN ]
To be fair, the point of having a set of "defined behavior" was in part so that compilers could optimize. I still believe this case is a compiler bug, but it is one that can only be invoked with undefined behavior, in which compilers are allowed to do absolutely anything. See also: DeathStation 9000
I'd really suggest watching https://www.youtube.com/watch?v=yG1OZ69H_-o
https://youtu.be/yG1OZ69H_-o?t=401
Thank you very much. Maybe the defenders of idiotic compiler behaviour can go now and hide under a rock.
As for the slide at https://youtu.be/yG1OZ69H_-o?t=508 Correct or incorrect programs are defined in terms of the language. With an underspecified language like C you get what you deserve: -O2 being a different language than -O0
I've seen enough of this video where incorrect programs are being equaled to undefined language behavior. I'll stop looking further.