This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
i386 clobbering
- To: bug-gcc at gnu dot org
- Subject: i386 clobbering
- From: "Joachim Schwender" <jschwender at ferrofluidics dot com>
- Date: Thu, 28 Oct 1999 10:42:53 +0200
- Organization: Ferrofluidics GmbH
GCC Version: 2.95.1 versus 2.94
SYSTEM: ix86-Linux 2.2.13 (SuSE 6.2)
Kernel compiling with newly installed 2.95.1 caused the error
described on
http://www.gnu.org/software/gcc/faq.html#asmclobber
foo.c:7: fixed or forbidden register 0 (ax) was spilled for class
AREG.
where as compiling with the v2.94 (included in SuSE 6.2) worked
well. From my knowledge, the kernel code from 2.2x on should be
ok concerning the clobbering. the main make-file tests ans inserts
the required otion to the compiler: -fno-strict-aliasing. The
mentioned part of code in .../delay.h is adapted, so should the part
in /drivers/char/hfmodem/refclock.c which caused the mentioned
error message:
hfmodem_time_t
hfmodem_refclock_current(struct hfmodem_state
*dev, hfmodem_time_t expected, int exp_valid)
{
struct timeval tv;
hfmodem_time_t curtime;
long diff;
hfmodem_time_t hfmodem_refclock_current(struct hfmodem_state *dev, hfmodem_time_t expected, int exp_valid)
{
struct timeval tv;
hfmodem_time_t curtime;
long diff;
#ifdef __i386__
if (rdtsc_ok) {
unsigned int tmp0, tmp1;
unsigned int tmp2, tmp3;
__asm__("rdtsc;\n\t"
"subl %2,%%eax\n\t"
"sbbl %3,%%edx\n\t" : "=&a" (tmp0), "=&d" (tmp1)
>>>>> : "m" (dev->clk.starttime_lo), "m" (dev->clk.starttime_hi) : "ax", "dx");
>>>>> __asm__("mull %1" : "=d" (tmp2) : "m" (scale_rdtsc), "a" (tmp0) : "ax");
__asm__("mull %1" : "=a" (tmp3) : "m" (scale_rdtsc), "a" (tmp1) : "dx");
curtime = tmp2 + tmp3;
goto time_known;
}
#endif /* __i386__ */
Any comments?
Joachim Schwender
Produktspezialist Ferrofluid
Ferrofluidics GmbH, Hohes Gestade 14, 72622 Nuertingen
Registergericht Nuertingen HRB 9964,
Geschaeftsführer: Juergen Zinsstag, Andreas Quendt
Tel: +49 7022 9270 19, Fax: +49 7022 9270 10