Using Mihai's suggestion, I determined the list of options turned on for 
-O2 that aren't turned on for -O.  Trying each of the additional flags 
one by one showed that only -finline-small-functions causes the bug to 
appear.  Here is sqlite3 compiled with '-g -O2 -fno-inline-small-functions".
$ make CFLAGS="-g -O2 -fno-inline-small-functions" clean sqlite3 > 
/dev/null ; ./sqlite3 foo "select 1.0 / 3.0; "
0.333333333333333
$
Here is sqlite3 compiled with "-g -O -finline-small-functions".
$ make CFLAGS="-g -O -finline-small-functions" clean sqlite3 > /dev/null 
; ./sqlite3 foo "select 1.0 / 3.0; "

$


Mihai Limbasan wrote:
>
> You can check exactly which flags gcc turns on by -O2 (or any other flag 
> combination, for that matter, including the machine-specific -m flag 
> family) by following this procedure:
>
> 1. Create an empty source file:
>
>     touch dummy.c
>
> 2. Run it though the compiler pass, adding -Q -v to the command line:
>
>     gcc -c -Q -v dummy.c
>
>
> Another option is checking gcc's specs file, but I think that's much 
> more cumbersome.
>
> Hope this helps.
>
> Mihai Limbasan
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>   

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to