pgsql: Work around gcc 4.6.0 bug that breaks WAL replay. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Work around gcc 4.6.0 bug that breaks WAL replay.
Date
Msg-id E1QV8so-0007Hg-Ed@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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

Branch
------
REL8_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/0f452e8ef4eb7d6cde86ca8c5a2ab60044041a4c

Modified Files
--------------
src/backend/access/transam/xlog.c |   20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Work around gcc 4.6.0 bug that breaks WAL replay.
Next
From: Tom Lane
Date:
Subject: pgsql: Work around gcc 4.6.0 bug that breaks WAL replay.