Install a workaround for a longstanding gcc bug that allows SIGFPE traps

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 828fc43c8c69f6f601c5ebc3a76b9dda5fcebaf6
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2009-09-03T18:48:21Z
Releases: 8.4.1
Install a workaround for a longstanding gcc bug that allows SIGFPE traps
to occur for division by zero, even though the code is carefully avoiding
that.  All available evidence is that the only functions affected are
int24div, int48div, and int28div, so patch just those three functions to
include a "return" after the ereport() call.

Backpatch to 8.4 so that the fix can be tested in production builds.
For older branches our recommendation will continue to be to use -O1
on affected platforms (which are mostly non-mainstream anyway).

Files

PathChange+/−
src/backend/utils/adt/int8.c modified +11 −1
src/backend/utils/adt/int.c modified +6 −1