Monday, August 11, 2008

[HACKERS] Skimming icc warnings on mongoose

I happened to be skimming the compile warnings on mongoose, an icc buildfarm
member and noticed two interesting warnings.

----------------------------------------------------------------
icc -O3 -xN -parallel -ip -mp1 -fno-strict-aliasing -g -fpic -I../../../src/include/snowball -I../../../src/include/snowball/libstemmer -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/et -c -o stem_UTF_8_swedish.o ./libstemmer/stem_UTF_8_swedish.c
icc -O3 -xN -parallel -ip -mp1 -fno-strict-aliasing -g -fpic -I../../../src/include/snowball -I../../../src/include/snowball/libstemmer -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/et -c -o stem_UTF_8_turkish.o ./libstemmer/stem_UTF_8_turkish.c
icc -O3 -xN -parallel -ip -mp1 -fno-strict-aliasing -g -fpic -shared dict_snowball.o api.o utilities.o stem_ISO_8859_1_danish.o stem_ISO_8859_1_dutch.o stem_ISO_8859_1_english.o stem_ISO_8859_1_finnish.o stem_ISO_8859_1_french.o stem_ISO_8859_1_german.o stem_ISO_8859_1_hungarian.o stem_ISO_8859_1_italian.o stem_ISO_8859_1_norwegian.o stem_ISO_8859_1_porter.o stem_ISO_8859_1_portuguese.o stem_ISO_8859_1_spanish.o stem_ISO_8859_1_swedish.o stem_ISO_8859_2_romanian.o stem_KOI8_R_russian.o stem_UTF_8_danish.o stem_UTF_8_dutch.o stem_UTF_8_english.o stem_UTF_8_finnish.o stem_UTF_8_french.o stem_UTF_8_german.o stem_UTF_8_hungarian.o stem_UTF_8_italian.o stem_UTF_8_norwegian.o stem_UTF_8_porter.o stem_UTF_8_portuguese.o stem_UTF_8_romanian.o stem_UTF_8_russian.o stem_UTF_8_spanish.o stem_UTF_8_swedish.o stem_UTF_8_turkish.o -L../../../src/port -o dict_snowball.so
ld: warning: creating a DT_TEXTREL in object.
----------------------------------------------------------------

There are a few instances of this. I think it indicates we are either spelling
-fpic wrong or including some .o object that was not compiled with -fpic
(perhaps something from the ports directory?).

This can result in a performance drain when the .so is linked in since the
text segment can't be mapped directly from the file and instead needs to be
read in and adjusted to the base address to which it was loaded.

It isn't unique to tsearch stuff either, plpgsql has the same warning:

----------------------------------------------------------------
make[4]: Entering directory `/home/data/local/jeremyd/postgres/buildfarm/root/HEAD/pgsql.4376/src/pl/plpgsql/src'
bison -y -d gram.y
mv -f y.tab.c ./pl_gram.c
mv -f y.tab.h ./pl.tab.h
LC_CTYPE=C /usr/bin/flex -o'pl_scan.c' scan.l
icc -O3 -xN -parallel -ip -mp1 -fno-strict-aliasing -g -fpic -I. -I../../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/et -c -o pl_gram.o pl_gram.c
pl_scan.c(1944) : (col. 2) remark: LOOP WAS VECTORIZED.
pl_scan.c(2495) : (col. 2) remark: LOOP WAS VECTORIZED.
icc -O3 -xN -parallel -ip -mp1 -fno-strict-aliasing -g -fpic -I. -I../../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/et -c -o pl_handler.o pl_handler.c
pl_handler.c(199) : (col. 3) remark: LOOP WAS VECTORIZED.
pl_handler.c(200) : (col. 3) remark: LOOP WAS VECTORIZED.
pl_handler.c(206) : (col. 4) remark: LOOP WAS VECTORIZED.
icc -O3 -xN -parallel -ip -mp1 -fno-strict-aliasing -g -fpic -I. -I../../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/et -c -o pl_comp.o pl_comp.c
pl_comp.c(157) : (col. 3) remark: LOOP WAS VECTORIZED.
pl_comp.c(211) : (col. 4) remark: LOOP WAS VECTORIZED.
icc -O3 -xN -parallel -ip -mp1 -fno-strict-aliasing -g -fpic -I. -I../../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/et -c -o pl_exec.o pl_exec.c
icc -O3 -xN -parallel -ip -mp1 -fno-strict-aliasing -g -fpic -I. -I../../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/et -c -o pl_funcs.o pl_funcs.c
icc -O3 -xN -parallel -ip -mp1 -fno-strict-aliasing -g -fpic -shared pl_gram.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o -L../../../../src/port -o plpgsql.so
ld: warning: creating a DT_TEXTREL in object.
----------------------------------------------------------------


And then there's this -- plen is a size_t...

plpython.c(1420): warning #186: pointless comparison of unsigned integer with zero
Assert(plen >= 0 && plen < mlen);


--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Get trained by Bruce Momjian - ask me about EnterpriseDB's PostgreSQL training!

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

No comments: