BUG #4052: GCC update -fwrapv and new -Wstrict-overflow

Поиск
Список
Период
Сортировка
От
Тема BUG #4052: GCC update -fwrapv and new -Wstrict-overflow
Дата
Msg-id 200803241620.m2OGKofU088602@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #4052: GCC update -fwrapv and new -Wstrict-overflow  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      4052
Logged by:
Email address:      mjevans1983@gmail.com
PostgreSQL version: 8.3.1
Operating system:   Linux
Description:        GCC update -fwrapv and new -Wstrict-overflow
Details:

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

-Wstrict-overflow=5  can be used to find cases where optimizations break not
standard specified overflow cases.  (However it sounds like even at level 5
it will only highlight cases that break, not all overflows?)

Quoting:
"However, gcc does need to respond to the concerns of the user community. I
introduced two new options in gcc 4.2. The first is -fno-strict-overflow.
This tells the compiler that it may not assume that signed overflow is
undefined. The second is -Wstrict-overflow. This tells the compiler to warn
about cases where it is using the fact that signed overflow is undefined to
implement an optimization. With these options it is possible to detect cases
where signed overflow occurs in a program, and it is possible to disable
optimizations which rely on signed overflow until the program is fixed. The
-Wstrict-overflow warning even found one minor case where gcc itself relied
on wrapping signed overflow, in the handling of division by the constant
0×80000000."

With a special comment:
"ncm said,

January 10, 2008 @ 2:53 pm

I see what happened:

$ gcc -O3 -Wstrict-overflow=5 -Wall -c t.c

is not the same as

$ gcc -O3 -Wall -Wstrict-overflow=5 -c t.c

Evidently the -Wall in the first example bumps the warning level back down
to 1. ..."

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "Pavan Deolasee"
Дата:
Сообщение: Re: BUG #4051: ERROR: relation with OID xxxx does not exist
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #4052: GCC update -fwrapv and new -Wstrict-overflow