This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: GCC optimization bug?
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Andrew Haley <aph at redhat dot com>
- Cc: Lee Duhem <lee dot duhem at gmail dot com>, anubhav <anubhav at cse dot iitb dot ac dot in>, gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Tue, 17 Jan 2017 10:38:05 +0000
- Subject: Re: GCC optimization bug?
- Authentication-results: sourceware.org; auth=none
- References: <8bd91f0702cba1bb8ea712e572a52c3b@cse.iitb.ac.in> <CAOSer0CpSKoCZuPT8ePdVEKm52cq-3=F_8b14=Ev-UzraNfuCA@mail.gmail.com> <552a08ff-3742-a37e-b379-296105796ef2@redhat.com>
On 17 January 2017 at 10:29, Andrew Haley wrote:
> On 17/01/17 10:20, Lee Duhem wrote:
>> In C, integer overflow is an undefined behavior.
>
> -fno-strict-overflow is supposed to fix that.
Is it? That would make it equivalent to -fwrapv and I don't think that's true.
-fno-strict-overflow means the compiler doesn't make certain
assumptions about overflow, but if overflow actually happens (as in
this program) it is still undefined.