On 2017-10-17 04:42 -0400, Jeffrey Walton wrote: > > > GCC guesses wrong on occasion. It will remove code that has value that > > > but does not produce an output because the language does not allow us > > > to express it. > > > > Yes, the compiler is bad at guessing what you mean. It does not even > > try; it only cares about what you *say*. > > I've had both SIGILL probes and memory zeroizers removed by GCC. I was > very clear about what I said should be done. > > The language did not give me a way to tell GCC, please don't mess with > this code and please ensure it executes like I've written it. Optimization is just "messing with code". If you don't like it, put your code in a standalone translation unit and use -O0. Modern C is not an "advanced assembly language". The compilers are not intelligent. They don't know your intention. > Jeff -- Xi Ruoyao <ryxi@xxxxxxxxxxxxxxxxx> School of Aerospace Science and Technology, Xidian University