Re: [PATCH 0/3] Work around icc miscompilation - Mailing list pgsql-hackers

From Xi Wang
Subject Re: [PATCH 0/3] Work around icc miscompilation
Date
Msg-id 51010D62.2010101@gmail.com
Whole thread Raw
In response to Re: [PATCH 0/3] Work around icc miscompilation  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Responses Re: [PATCH 0/3] Work around icc miscompilation
List pgsql-hackers
On 1/24/13 5:02 AM, Heikki Linnakangas wrote:
> These patches look ok at a quick glance, but how do we ensure this kind 
> of problems don't crop back again in the future? Does icc give a warning 
> about these? Do we have a buildfarm animal that produces the warnings?
> 
> If we fix these, can we stop using -frapv on gcc? Is there any way to 
> get gcc to warn about these?

Thanks for reviewing.

gcc has this -Wstrict-overflow option to warn against overflow checks
that may be optimized away.  The result in inaccurate: it may produce
a large number of false warnings, and it may also miss many cases (esp.
when gcc's value-range-propagation fails to compute variables' ranges).

Not sure if other compilers have similar options.

I find these broken checks using a static checker I'm developing, and
only report cases that existing compilers do miscompile.  If you are
interested, I'll post a complete list of overflow checks in pgsql that
invoke undefined behavior and thus may be killed by future compilers.

I believe we can get rid of -fwrapv once we fix all such checks.

- xi



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: patch submission: truncate trailing nulls from heap rows to reduce the size of the null bitmap [Review]
Next
From: Heikki Linnakangas
Date:
Subject: Re: logical changeset generation v4 - Heikki's thoughts about the patch state