Re: [HACKERS] strict aliasing (was: const correctness)

2011-11-14 Thread Andres Freund
On Monday, November 14, 2011 10:22:52 PM Tom Lane wrote: > "Kevin Grittner" writes: > >> Tom Lane wrote: > >>> Dunno ... where were the warnings exactly? > > > > From HEAD checkout of a few minutes ago I now see only 9: > Hmm ... well, none of those look likely to be in performance-sensitive > a

Re: [HACKERS] strict aliasing (was: const correctness)

2011-11-14 Thread Andres Freund
On Monday, November 14, 2011 10:25:19 PM Alvaro Herrera wrote: > Excerpts from Kevin Grittner's message of lun nov 14 17:30:50 -0300 2011: > > Tom Lane wrote: > > > "Kevin Grittner" writes: > > >> Also, is there something I should do to deal with the warnings > > >> before this would be considere

Re: [HACKERS] strict aliasing (was: const correctness)

2011-11-14 Thread Martijn van Oosterhout
On Mon, Nov 14, 2011 at 06:25:19PM -0300, Alvaro Herrera wrote: > > All 10 were like this: > > > > warning: dereferencing type-punned pointer will break > > strict-aliasing rules > > Uhm, shouldn't we expect there to be one warning for each use of a Node > using some specific node pointer

Re: [HACKERS] strict aliasing (was: const correctness)

2011-11-14 Thread Alvaro Herrera
Excerpts from Kevin Grittner's message of lun nov 14 17:30:50 -0300 2011: > Tom Lane wrote: > > "Kevin Grittner" writes: > >> Also, is there something I should do to deal with the warnings > >> before this would be considered a meaningful test? > > > > Dunno ... where were the warnings exactly

Re: [HACKERS] strict aliasing (was: const correctness)

2011-11-14 Thread Tom Lane
"Kevin Grittner" writes: >> Tom Lane wrote: >>> Dunno ... where were the warnings exactly? > From HEAD checkout of a few minutes ago I now see only 9: Hmm ... well, none of those look likely to be in performance-sensitive areas. But I wonder just how good the trouble-detection code is these d

Re: [HACKERS] strict aliasing (was: const correctness)

2011-11-14 Thread Kevin Grittner
"Kevin Grittner" wrote: > Tom Lane wrote: >> "Kevin Grittner" writes: >>> Also, is there something I should do to deal with the warnings >>> before this would be considered a meaningful test? >> >> Dunno ... where were the warnings exactly? > > All 10 were like this: > > warning: deref

Re: [HACKERS] strict aliasing (was: const correctness)

2011-11-14 Thread Kevin Grittner
Tom Lane wrote: > Dunno ... where were the warnings exactly? Ah, you asked "where", not "what". I don't think I saved that, and I had to reboot for a new kernel, so I don't have the buffer sitting around. I'll do a new build and let you know shortly. -Kevin -- Sent via pgsql-hackers mail

Re: [HACKERS] strict aliasing (was: const correctness)

2011-11-14 Thread Kevin Grittner
Tom Lane wrote: > "Kevin Grittner" writes: >> The results were interesting. While the small overlap between >> samples from the two builds at most levels means that this was >> somewhat unlikely to be just sampling noise, there could have >> been alignment issues that account for some of the dif

Re: [HACKERS] strict aliasing (was: const correctness)

2011-11-14 Thread Tom Lane
"Kevin Grittner" writes: > The results were interesting. While the small overlap between > samples from the two builds at most levels means that this was > somewhat unlikely to be just sampling noise, there could have been > alignment issues that account for some of the differences. In > short,

Re: [HACKERS] strict aliasing (was: const correctness)

2011-11-14 Thread Kevin Grittner
Florian Pflug wrote: > If we're concerned about helping the compiler produce better code, > I think we should try to make our code safe under strict aliasing > rules. AFAIK, that generally helps much more than > const-correctness. (Dunno how feasible that is, though) To get a preliminary feel