This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Signed int overflow behaviour in the security context


Andreas Bogk wrote:
Making a call here before knowing this is not sensible.  In fact, I'm
tempted to argue that it is generally a bad idea to do optimizations
that lead to the same expression being evaluated to different results
without making the user explicitly request them.

Anything other than -O0 is inherently a request for optimizations that lead to different evaluations of undefined behavior.


This is inherent in the concept that optimizations change the code, and that things that lead to undefined behavior will lead to dependencies on aspects of the code that the compiler does not consider to be invariants when making those changes.

The compiler does, in fact, default to -O0 unless users explicitly request something else. This is no more and no less than what you are tempted to argue for.

- Brooks


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]