1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Improved comments on the work-around to the GCC x86 floating point wonkiness.

FossilOrigin-Name: 7b4c16731e7bf6f03f5adf4fcb2008c0b19be473fb1b90b405c217c08916586a
This commit is contained in:
drh
2023-07-05 19:56:14 +00:00
parent e68899f1e4
commit 728650ecb3
3 changed files with 20 additions and 9 deletions

View File

@@ -387,9 +387,20 @@ u8 sqlite3StrIHash(const char *z){
}
/*
** Work around an apparent bug in GCC.
** Work around an issue in GCC where it generates code that stores
** intermediate results to a higher precision than binary64. This
** messes up the Dekker algorithm. See the discussion at
** https://sqlite.org/forum/info/ee7278611394034c
**
** By adding the -ffloat-store option, it forces GCC to truncate
** intermediate results to the correct precision. The GCC devs
** recommended -fexcess-precision=standard or -std=c99. Those options
** work too, from the command-line, but I could not get them to work
** as a #pragma. We want the "sqlite3.c" to "just work" without
** requiring any special compiler-options, so we continue to use
** the -ffloat-store method of working around the issue.
*/
#ifdef i386
#pragma GCC push_options
#pragma GCC optimize("float-store")
@@ -423,7 +434,7 @@ static void dekkerMul2(double *x, double y, double yy){
x[1] += cc;
}
/* End of the GCC bug work-around */
/* End of the GCC x86 floating-point work-around */
#ifdef i386
#pragma GCC pop_options
#endif