SQLite Forum

Misoptimization in ieee754func
Login

Misoptimization in ieee754func

(1) By yongheng on 2021-03-02 03:09:08 [link] [source]

In case you miss it, I opened a ticket at https://www.sqlite.org/src/tktview/22dea1cfdb9151e48fe99cebbd3c92519d334de6.

When using optimization level >= 2, many compilers misoptimize ieee754 in SQLite, including the latest release version of GCC and clang.

The misoptimized code is in https://github.com/sqlite/sqlite/blob/4ad1a1c74caeee76124091e6e1771fae4afa1a33/ext/misc/ieee754.c#L165

I think the integer overflow at https://github.com/sqlite/sqlite/blob/4ad1a1c74caeee76124091e6e1771fae4afa1a33/ext/misc/ieee754.c#L186 caused the problem.

(2) By yongheng on 2021-03-02 22:12:50 in reply to 1 [source]

Fix in https://www.sqlite.org/src/tktview?name=22dea1cfdb