Re: fix for strict-alias warnings

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: fix for strict-alias warnings
Дата
Msg-id 005b01c3914b$a80dfe90$6401a8c0@DUNSLANE
обсуждение исходный текст
Ответ на Re: fix for strict-alias warnings  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: fix for strict-alias warnings  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
----- Original Message -----
From: "Tom Lane" <tgl@sss.pgh.pa.us>

> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > I have attached and applied the following patch to use makeNode for
> > structures that will later be cast to Node*, rather than having them be
> > allocated as stack variables.
>
> AFAICT, this adds unnecessary palloc overhead without actually reducing
> the risk of optimization problems.
>

Even without the extra overhead, the danger of strict-aliasing is not just
related to alignment. As I understand it, given strict-aliasing assumptions
the compiler is free to reorder some operations on things it thinks can't be
the same thing, or even optimise them away because they can have no effect.
I'm not 100% sure we have avoided that danger.

Quote from nice page on this subject: "ISO C is not your grandfather's C".
:-)

cheers

andrew


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: fix for strict-alias warnings
Следующее
От: Tom Lane
Дата:
Сообщение: Re: fix for strict-alias warnings