From 728650ecb33585d67eea9e5c1ae82df81a46c9cb Mon Sep 17 00:00:00 2001 From: drh <> Date: Wed, 5 Jul 2023 19:56:14 +0000 Subject: [PATCH] Improved comments on the work-around to the GCC x86 floating point wonkiness. FossilOrigin-Name: 7b4c16731e7bf6f03f5adf4fcb2008c0b19be473fb1b90b405c217c08916586a --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/util.c | 15 +++++++++++++-- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index f132d2fafa..079596dfbe 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Work\saround\sfor\san\sapparent\sGCC\sbug.\s\sSee\n[forum:/info/ee7278611394034c|forum\spost\see7278611394034c]\sfor\sdetails. -D 2023-07-05T18:59:52.671 +C Improved\scomments\son\sthe\swork-around\sto\sthe\sGCC\sx86\sfloating\spoint\swonkiness. +D 2023-07-05T19:56:14.847 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -705,7 +705,7 @@ F src/trigger.c ad6ab9452715fa9a8075442e15196022275b414b9141b566af8cdb7a1605f2b0 F src/update.c 0aa36561167a7c40d01163238c297297962f31a15a8d742216b3c37cdf25f731 F src/upsert.c 5303dc6c518fa7d4b280ec65170f465c7a70b7ac2b22491598f6d0b4875b3145 F src/utf.c ee39565f0843775cc2c81135751ddd93eceb91a673ea2c57f61c76f288b041a0 -F src/util.c c8a4c99081e378a4562e24f6c2e81319dc2d399c82c12f9b75ad3fd5ecde178d +F src/util.c 49a7335c225a7019d4b81606d65d105856a181ed122f25338d2323174a6e4a93 F src/vacuum.c 604fcdaebe76f3497c855afcbf91b8fa5046b32de3045bab89cc008d68e40104 F src/vdbe.c 74282a947234513872a83b0bab1b8c644ece64b3e27b053ef17677c8ff9c81e0 F src/vdbe.h 41485521f68e9437fdb7ec4a90f9d86ab294e9bb8281e33b235915e29122cfc0 @@ -2043,8 +2043,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 28f57b34e6b11184a36e363a985e7531bddd7be48a5e039a670e5acf748eedda -R c8ff71fb703fd93e733ec7777485c76e +P 5d9e9364808793d65925d4efbfde0f4246df258758f15e8ce1105070d1018fe6 +R 721b48a97d77f38539bb9af05ab5869d U drh -Z ae8486dcf7227b47ea3089bba703cbf5 +Z c80d89ca100028001e859be8d9af6fed # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 35588ce08d..e14a618436 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -5d9e9364808793d65925d4efbfde0f4246df258758f15e8ce1105070d1018fe6 \ No newline at end of file +7b4c16731e7bf6f03f5adf4fcb2008c0b19be473fb1b90b405c217c08916586a \ No newline at end of file diff --git a/src/util.c b/src/util.c index 52dc09a7d2..6b757e4fb7 100644 --- a/src/util.c +++ b/src/util.c @@ -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