@RalfJung That's my point; the program is broken because of wonky pointer misuse, not because of optimizations. If you decide to do wonky invalid things with pointers, whether that be generating random numbers or reaching past the end of an array, then stuff (including optimizations) is going to break. I could be wrong, but I don't think the C standard even guarantees the layout of variables on the stack. Even if it does, it's a really bad idea to leverage that.