]> granicus.if.org Git - postgresql/commit
Work around gcc 4.6.0 bug that breaks WAL replay.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 10 Jun 2011 21:03:27 +0000 (17:03 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 10 Jun 2011 21:03:27 +0000 (17:03 -0400)
commit0f452e8ef4eb7d6cde86ca8c5a2ab60044041a4c
tree3adc10cb62b6f1c6e8d91ab1a8a8cb2c25b99cbc
parente5b50d0ffb72935b844a2d78b6f81e3b6c85cba9
Work around gcc 4.6.0 bug that breaks WAL replay.

ReadRecord's habit of using both direct references to tmpRecPtr and
references to *RecPtr (which is pointing at tmpRecPtr) triggers an
optimization bug in gcc 4.6.0, which apparently has forgotten about
aliasing rules.  Avoid the compiler bug, and make the code more readable
to boot, by getting rid of the direct references.  Improve the comments
while at it.

Back-patch to all supported versions, in case they get built with 4.6.0.

Tom Lane, with some cosmetic suggestions from Alex Hunsaker
src/backend/access/transam/xlog.c