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.

People always say this, but they don't really realize what they are saying. This would mean you could not put variables in registers, and would essentially totally disable optimization. The -O2 flag is exactly a request to do optimizations that may cause wrong programs to generate different results.

Note by the way that formally safety-critical or security-critical
software is very unlikely to be compiled at -O2 anyway.


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