Some fun with -O2

David Marec david at lapinbilly.eu
Thu Jan 14 19:09:30 UTC 2021


On 14/01/2021 15:22, Ed Maste wrote:
> On Thu, 14 Jan 2021 at 07:17, Thierry Thomas <thierry at freebsd.org> wrote:
>>> Workaround is to add -fwrapv compiler switch.
>> Indeed, but the fun part is the different behaviour with / without -O2.
> Perhaps fun, but not surprising; this is a consequence of some optimization.


Actually, this is documented in the /autoconf/ manual:

https://www.gnu.org/software/autoconf/manual/autoconf-2.70/autoconf.html#Integer-Overflow-Basics 



-- 

It's a trap!

David Marec

http://wiki.fug-fr.org/doku.php?id=start



More information about the freebsd-hackers mailing list