Is it OK that gcc optimizes away overflow check?

Andrew Haley aph@redhat.com
Mon Aug 1 08:59:00 GMT 2011


On 07/31/2011 12:30 AM, Vincent Lefevre wrote:
> On 2011-07-25 17:21:42 +0100, Andrew Haley wrote:
>> gcc is already safe, though: we don't do any optimizations that
>> generate incorrect code.
> 
> Not always (but bugs have been reported about incorrect optimizations).

Well, obviously we have bugs.  I hope it was clear that we don't
do unsafe optimizations, i.e. those that turn well-defined code
into something that isn't.  Except by mistake!  We're not perfect.

Andrew.



More information about the Gcc-help mailing list