Re: fix for strict-alias warnings - Mailing list pgsql-patches

From Tom Lane
Subject Re: fix for strict-alias warnings
Date
Msg-id 687.1066164185@sss.pgh.pa.us
Whole thread Raw
In response to Re: fix for strict-alias warnings  (Manfred Spraul <manfred@colorfullife.com>)
Responses Re: fix for strict-alias warnings
List pgsql-patches
Manfred Spraul <manfred@colorfullife.com> writes:
> After some massaging, I've succeeded in generating bad code using a
> slightly modified MemSetAligned macro (parameters -O2
> -fstrict-aliasing): gcc pipelined the x*x around the memset.

As I already explained, we do not care about the MemSetAligned case.
Is gcc 3.3 smart enough to optimize away the pointer alignment test
in the full macro?

(Hm, if so, maybe that explains Bruce's observation that the warning
only shows up with Node structs that are allocated as local
variables, rather than palloc'd ... that would be the only case where
gcc could possibly optimize away the alignment test ...)

            regards, tom lane

pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: Re: fix for strict-alias warnings
Next
From: Peter Eisentraut
Date:
Subject: Re: fix for strict-alias warnings