Re: fix for strict-alias warnings

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Manfred Spraul <manfred(at)colorfullife(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: fix for strict-alias warnings
Date: 2003-10-14 20:43:05
Message-ID: 687.1066164185@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Manfred Spraul <manfred(at)colorfullife(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2003-10-14 20:45:17 Re: fix for strict-alias warnings
Previous Message Peter Eisentraut 2003-10-14 20:41:41 Re: [PERFORM] Sun performance - Major discovery!

Browse pgsql-patches by date

  From Date Subject
Next Message Peter Eisentraut 2003-10-14 20:45:17 Re: fix for strict-alias warnings
Previous Message Neil Conway 2003-10-14 20:38:17 Re: fix for strict-alias warnings