This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: other/7329: fixed or forbidden register bug (and test case)
- From: ehrhardt at mathematik dot uni-ulm dot de
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, lupus at debian dot org, nobody at gcc dot gnu dot org
- Date: 10 Dec 2002 00:12:52 -0000
- Subject: Re: other/7329: fixed or forbidden register bug (and test case)
- Reply-to: ehrhardt at mathematik dot uni-ulm dot de, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, lupus at debian dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Synopsis: fixed or forbidden register bug (and test case)
State-Changed-From-To: open->closed
State-Changed-By: cae
State-Changed-When: Mon Dec 9 16:12:52 2002
State-Changed-Why:
The code is wrong. Your are not allowed to globber %ebx or use it
as an asm operand if compiling PIC code. %ebx is used by the pic code
itself to address pc relative data. I think a workaround could be
to do something like this:
__asm__ __volatile__ ("xchg %edi,%ebx\n\tcpuid\n\txchg %edi,%ebx":...)
and use edi for the output operand. gcc probably can't detect the
save and restore of ebx, however, this might still be illegal code.
regards Christian
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7329