id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
4803	"""can't find a register in class ‘BREG’ while reloading ‘asm’"" - problem with dynamic link libraries"	guest		"When compiling the cpuid package with dynamic link libraries I get the following error:
{{{
$ cabal install --enable-shared cpuid-0.2
...
cbits/cpuid.c: In function ‘cpuid’:

cbits/cpuid.c:7:0:
     error: can't find a register in class ‘BREG’ while reloading ‘asm’

cbits/cpuid.c:7:0:  error: ‘asm’ operand has impossible constraints
...
}}}

The shortest call of ghc to reproduce this error is:
{{{
cpuid-0.2/cbits$ ghc -fPIC -c cpuid.c
}}}

The shortest call of gcc to reproduce this error is:
{{{
cpuid-0.2/cbits$ gcc -fPIC -c cpuid.c
}}}

The content of cpuid.c is:
{{{
void cpuid(int in, int * aa, int * bb, int * cc, int * dd)
{
  int a, b, c, d;
  asm(""cpuid"": ""=a"" (a), ""=b"" (b), ""=c"" (c), ""=d"" (d) : ""a"" (in));
  *aa = a;
  *bb = b;
  *cc = c;
  *dd = d;
}
}}}

Shall I consider this a bug of GHC or of the cpuid package?
Since GCC complains about this problem, I'm afraid it must be solved in the cpuid package.
Just wanted to make sure the problem is reported somewhere.
"	bug	closed	normal		Compiler	6.12.3	invalid		ghc@…	Linux	x86	GHC rejects valid program					
