[Bug tree-optimization/44897] -flto + ipa-sra misoptimize sqlite (non-plugin only)

markus at trippelsdorf dot de gcc-bugzilla@gcc.gnu.org
Thu Mar 10 16:07:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44897

--- Comment #11 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2011-03-10 16:07:34 UTC ---
In the Firefox case sqlite3.o gets compiled correctly,
it is libmozsqlite3.so that segfaults when compiled with -flto
and -fprofile-use :

gcc  -Wall -W -Wno-unused -Wpointer-arith -Wcast-align -W -pedantic
-Wno-long-long -march=native -fpermissive -fno-strict-aliasing -pthread -pipe 
-DNDEBUG -DTRIMMED -flto=4 -fwhole-program -fprofile-use -fprofile-correction
-Wcoverage-mismatch -freorder-blocks-and-partition -O3 -fPIC -shared
-Wl,-z,defs -Wl,-h,libmozsqlite3.so -o libmozsqlite3.so  sqlite3.o    
-lpthread -Wl,-O1,--hash-style=gnu,--as-needed,--no-keep-memory  -fprofile-use
-Wl,-rpath-link,/var/tmp/mozilla-central/moz-build-dir/dist/bin
-Wl,-rpath-link,/usr/lib   -ldl

This version runs fine (no -flto):

gcc -Wall -W -Wno-unused -Wpointer-arith -Wcast-align -W -pedantic
-Wno-long-long -march=native -fpermissive -fno-strict-aliasing -pthread -pipe
-DNDEBUG -DTRIMMED -Wcoverage-mismatch -freorder-blocks-and-partition
-fwhole-program -fprofile-use -O3 -fPIC -shared -Wl,-z,defs
-Wl,-h,libmozsqlite3.so -o libmozsqlite3.so sqlite3.o -lpthread
-Wl,-O1,--hash-style=gnu,--as-needed,--no-keep-memory
-Wl,-rpath-link,/var/tmp/mozilla-central/moz-build-dir/dist/bin
-Wl,-rpath-link,/usr/lib -ldl

And this one gives an internal compiler error (only -flto , no -fprofile-use):

gcc -Wall -W -Wno-unused -Wpointer-arith -Wcast-align -W -pedantic
-Wno-long-long -march=native -fpermissive -fno-strict-aliasing -pthread -pipe
-DNDEBUG -DTRIMMED -Wcoverage-mismatch -freorder-blocks-and-partition -flto -O3
-fPIC -shared -Wl,-z,defs -Wl,-h,libmozsqlite3.so -o libmozsqlite3.so sqlite3.o
-lpthread -Wl,-O1,--hash-style=gnu,--as-needed,--no-keep-memory
-Wl,-rpath-link,/var/tmp/mozilla-central/moz-build-dir/dist/bin
-Wl,-rpath-link,/usr/lib -ldl
lto1: internal compiler error: Floating point exception
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper: /usr/x86_64-pc-linux-gnu/gcc-bin/4.6.0/gcc returned 1 exit status
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.0/../../../../x86_64-pc-linux-gnu/bin/ld:
fatal error: lto-wrapper failed
collect2: ld returned 1 exit status

(All these commands should be run from: 
./mozilla-central/moz-build-dir/db/sqlite3/src
One can copy the resulting libmozsqlite3.so directly into 
/usr/lib/firefox-4.0b13pre and try to start Firefox, to check
if it's OK or not)



More information about the Gcc-bugs mailing list