Re: fix for strict-alias warnings

From: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
To: "PG Patches" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: fix for strict-alias warnings
Date: 2003-10-13 05:34:21
Message-ID: 005b01c3914b$a80dfe90$6401a8c0@DUNSLANE
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


----- Original Message -----
From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>

> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-10-13 06:00:37 Re: fix for strict-alias warnings
Previous Message Tom Lane 2003-10-13 04:48:18 Re:

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2003-10-13 06:00:37 Re: fix for strict-alias warnings
Previous Message Tom Lane 2003-10-13 04:43:07 Re: fix for strict-alias warnings