This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: A patch for linux 2.1.127
- To: "H.J. Lu" <hjl at lucon dot org>, Linus Torvalds <torvalds at transmeta dot com>
- Subject: Re: A patch for linux 2.1.127
- From: Richard Henderson <rth at cygnus dot com>
- Date: Sun, 8 Nov 1998 21:44:40 -0800
- Cc: egcs at cygnus dot com, linux kernel <linux-kernel at vger dot rutgers dot edu>
- References: <m0zcaVi-000393C@ocean.lucon.org>
- Reply-To: Richard Henderson <rth at cygnus dot com>
On Sun, Nov 08, 1998 at 11:28:29AM -0800, H.J. Lu wrote:
> I don't know whom to blame. I have to say both. As you can see,
> calibrate_tsc is just asm code written in the asm statement.
What are you smoking? Of course it is a compiler problem.
The problem is the sort of general small register class losage that
has plagued us for some time, that is, silent failures when we run
out of reload registers. Which is thankfully solved now by Bernd's
recent herculean efforts.
Unfortunately, those patches are way too massive to go back to the
1.1 branch. For that I don't really know what to do.
I will note that as a workaround, there's no particular reason we
need to force this second value into a register at all, since it will
just be coped to %edx later.
r~
--- arch/i386/kernel/time.c.orig Sun Nov 8 21:35:18 1998
+++ arch/i386/kernel/time.c Sun Nov 8 21:36:44 1998
@@ -565,10 +565,9 @@
"movl %1, %%edx\n\t"
"divl %%ecx\n\t" /* eax= 2^32 / (1 * TSC counts per microsecond) */
/* Return eax for the use of fast_gettimeoffset */
- "movl %%eax, %0\n\t"
- : "=r" (retval)
- : "r" (5 * 1000020/HZ)
- : /* we clobber: */ "ax", "bx", "cx", "dx", "cc", "memory");
+ : "=&a" (retval)
+ : "g" (5 * 1000020/HZ)
+ : /* we clobber: */ "bx", "cx", "dx", "cc", "memory");
return retval;
}