Summary: | "error: can't find a register in class `BREG' while reloading `asm'" when I try to compile valgrind | ||
---|---|---|---|
Product: | [Developer tools] valgrind | Reporter: | Sabin Iacob <iacobs> |
Component: | general | Assignee: | Julian Seward <jseward> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 2.1.1 | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: |
Try to make cpuid less dependent on register allocations
Another go at fixing CPUID |
Description
Sabin Iacob
2004-04-15 14:59:45 UTC
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. |