|
From: Nicholas N. <nj...@cs...> - 2005-03-15 20:23:49
|
On Tue, 15 Mar 2005, Jeremy Fitzhardinge wrote: >> The number of functions that gcc inlines grows like kudzu. You can turn >> off specific VG-sensitive ones like memcpy by invoking the compiler with >> -fno-builtin-memcpy and so on. >> > That's OK for our tests, but it would be nice to have something which > works for arbitrary code X. Yes, otherwise memcpy() overlap checking does nothing. > Does it always inline memcpy, or only the ones with a constant length? Always, interestingly. It's smart enough to use movsb (if the length is unknown) or even movsl (if the length is fixed and a multiple of 4). >> See gcc/gcc/builtins.def for a complete list of the stuff that gcc >> handles specially. This frequently changes quite substantially from one >> minor release to the next (e.g. 3.3.2 -> 3.3.3), so don't assume it's >> static. Hmm, that's weird -- strcpy() is in that file on my installation, but it doesn't get inlined. More alarmingly, malloc() is also in that file... if gcc inlined that (how on earth could it?) that would be a disaster for Valgrind. N |