Need -fwrapv or -fno-strict-overflow for gcc-4.3 - Mailing list pgsql-hackers

From Kris Jurka
Subject Need -fwrapv or -fno-strict-overflow for gcc-4.3
Date
Msg-id Pine.BSO.4.64.0803100130580.30353@leary.csoft.net
Whole thread Raw
Responses Re: Need -fwrapv or -fno-strict-overflow for gcc-4.3
Re: Need -fwrapv or -fno-strict-overflow for gcc-4.3
List pgsql-hackers
A while back Tom Lane presented the potential problem with gcc signed 
overflow handling, but now it's not just a theoretical problem.

http://archives.postgresql.org/pgsql-hackers/2005-12/msg00635.php

Gcc 4.3 has started to perform optimizations based on the denial of the 
existence of signed overflow. Building CVS HEAD with gcc 4.3rc2 I get the 
following warnings:

localtime.c:1223: warning: assuming signed overflow does not occur when 
assuming that (X + c) < X is always false
localtime.c:1227: warning: assuming signed overflow does not occur when 
assuming that (X - c) > X is always false
array_userfuncs.c:100: warning: assuming signed overflow does not occur 
when assuming that (X - c) > X is always false
float.c:2696: warning: assuming signed overflow does not occur when 
assuming that (X + c) < X is always false
float.c:2712: warning: assuming signed overflow does not occur when 
assuming that (X + c) < X is always false
oracle_compat.c:1479: warning: assuming signed overflow does not occur 
when assuming that (X + c) < X is always false

I don't understand the difference between -fwrapv and 
-fno-strict-aliasing, but it seems we need at least one of them.

http://www.airs.com/blog/archives/120

Kris Jurka


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Negative LIMIT and OFFSET?
Next
From: Tom Lane
Date:
Subject: Re: Need -fwrapv or -fno-strict-overflow for gcc-4.3