News for hackers. Stuff that matters.
Re:On C-optimizing compilers removing code that has undefine... by sddfd on Saturday June 17, 2017 @05:33AM (#14575042)
Exactly. A compiler cannot guess what a programmer intended, but has to stick to the language semantics.

Also, the article goes on to argue that uninitialized memory is used to seed random generators, which is generally undefined behavior. I don't think this should be a valid use-case.

Re:On C-optimizing compilers removing code that has undefine... by andreareina on Saturday June 17, 2017 @05:54AM (#14575091)
That business about uninitialized values being used to seed RNGs threw me for a loop as well.

I think it's safe to say that x ^= x is equivalent to x = 0 and optimize it that way, just like compilers recognize common idioms for e.g. swapping, counting set bits, etc and emit the correct intrinsic instructions.

Re:On C-optimizing compilers removing code that has undefine... by GedByrne on Saturday June 17, 2017 @05:47AM (#14575074)
So go use rust and leave C for those who think it should.
Re:On C-optimizing compilers removing code that has undefine... by JCzynski on Saturday June 17, 2017 @12:44PM (#14576586)
I will communicate cryptographically with people using C, so no.