Version: 2.1.1 (using KDE KDE 3.2.2) Installed from: Gentoo Packages Compiler: gcc version 3.3.3 20040217 (Gentoo Linux 3.3.3, propolice-3.3-7) Configured with: /var/tmp/portage/gcc-3.3.3/work/gcc-3.3.3/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.3 --includedir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3/info --enable-shared --host=i686-pc-linux-gnu --target=i686-pc-linux-gnu --with-system-zlib --enable-languages=c,c++,f77,objc,java --enable-threads=posix --enable-long-long --disable-checking --enable-cstdio=stdio --enable-clocale=generic --enable-__cxa_atexit --enable-version-specific-runtime-libs --with-gxx-include-dir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/include/g++-v3 --with-local-prefix=/usr/local --enable-shared --enable-nls --without-included-gettext --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --enable-interpreter --enable-java-awt=xlib --with-x --disable-multilib OS: Linux make[4]: Entering directory `/usr/src/valgrind/valgrind-2.1.1/coregrind' if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I./demangle -I../include -I./x86 -DVG_LIBDIR="\"/usr/local/lib/valgrind"\" -Winline -Wall -Wshadow -O -fno-omit-frame-pointer -mpreferred-stack-boundary=2 -g -DELFSZ=32 -MT vg_to_ucode.o -MD -MP -MF ".deps/vg_to_ucode.Tpo" \ -c -o vg_to_ucode.o `test -f 'vg_to_ucode.c' || echo './'`vg_to_ucode.c; \ then mv -f ".deps/vg_to_ucode.Tpo" ".deps/vg_to_ucode.Po"; \ else rm -f ".deps/vg_to_ucode.Tpo"; exit 1; \ fi vg_to_ucode.c: In function `get_cpu_features': vg_to_ucode.c:109: error: can't find a register in class `BREG' while reloading `asm' vg_to_ucode.c:109: error: can't find a register in class `BREG' while reloading `asm' vg_to_ucode.c:109: error: can't find a register in class `BREG' while reloading `asm' make[4]: *** [vg_to_ucode.o] Error 1 make[4]: Leaving directory `/usr/src/valgrind/valgrind-2.1.1/coregrind' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/usr/src/valgrind/valgrind-2.1.1/coregrind' make[2]: *** [all] Error 2 make[2]: Leaving directory `/usr/src/valgrind/valgrind-2.1.1/coregrind' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/src/valgrind/valgrind-2.1.1' make: *** [all] Error 2 Tried 2.0.0, 2.1.1 and CVS HEAD, same result... exotic4 valgrind # uname -a Linux exotic4 2.6.5-gentoo #1 SMP Wed Apr 14 12:53:53 EEST 2004 i686 AMD Athlon(tm) XP 2200+ AuthenticAMD GNU/Linux exotic4 valgrind # gcc -v Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/specs Configured with: /var/tmp/portage/gcc-3.3.3/work/gcc-3.3.3/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.3 --includedir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3/info --enable-shared --host=i686-pc-linux-gnu --target=i686-pc-linux-gnu --with-system-zlib --enable-languages=c,c++,f77,objc,java --enable-threads=posix --enable-long-long --disable-checking --enable-cstdio=stdio --enable-clocale=generic --enable-__cxa_atexit --enable-version-specific-runtime-libs --with-gxx-include-dir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/include/g++-v3 --with-local-prefix=/usr/local --enable-shared --enable-nls --without-included-gettext --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --enable-interpreter --enable-java-awt=xlib --with-x --disable-multilib Thread model: posix gcc version 3.3.3 20040217 (Gentoo Linux 3.3.3, propolice-3.3-7)
I haven't seen anything like this before. Looks like a GCC issue rather than a Valgrind issue.
It is sort of a GCC issue, but not entirely. The way the cpuid() function in vg_to_ucode.c is written it is relying on being able to use EAX, EBX, ECX and EDX and if the GCC optimiser decides that it can't make all of those available because it needs them for other things then the constraints on the inline assembler will fail with the this error. In this case it is EBX that wasn't available for some reason, so the constraint on the ebx variable being bound to a register of class B will be failed.
Created attachment 6342 [details] Try to make cpuid less dependent on register allocations This patch makes the inline assembler used to probe the CPUID more conservative so that is less dependent on GCC being able to allocate lots of registers to it.
Created attachment 6389 [details] Another go at fixing CPUID Trying to inline CPUID is just way too hard due to all the implicit registers and given that we only use it at startup it's far easier to just to write a proper assembler routine to do it, so this patch does that and fixes both the core engine and cachegrind to use the new helper. Note that you need to rerun autogen.sh and configure after applying this patch.
Patch committed.