Subject: [PATCH] Fix gcc-3.4.x compilation

From: Thomas Koeller <[email-masked]>
Date: Mon, 26 Jul 2004 12:37:09 +0200

Hi,

compilation of the kernel with a 3.4.x compiler does not
work, because that compiler does no longer recognize
the 'accum' register pair specifier. This can easily be
fixed (patch attached). Since the meaning of 'accum'
used to be 'hi' and 'lo', all its uses were clearly
redundant.

--- linux-mips/arch/mips/kernel/time.c	2004-07-26 12:15:25.302897080 +0200
+++ linux-mips-work/arch/mips/kernel/time.c	2004-07-15 14:52:18.000000000 +0200
@@ -278,7 +278,7 @@
 	__asm__("multu	%1,%2"
 		: "=h" (res)
 		: "r" (count), "r" (sll32_usecs_per_cycle)
-		: "lo", "accum");
+		: "lo");
 
 	/*
 	 * Due to possible jiffies inconsistencies, we need to check
@@ -333,7 +333,7 @@
 	__asm__("multu  %1,%2"
 		: "=h" (res)
 		: "r" (count), "r" (quotient)
-		: "lo", "accum");
+		: "lo");
 
 	/*
 	 * Due to possible jiffies inconsistencies, we need to check
@@ -375,7 +375,7 @@
 				: "r" (timerhi), "m" (timerlo),
 				  "r" (tmp), "r" (USECS_PER_JIFFY),
 				  "r" (USECS_PER_JIFFY_FRAC)
-				: "hi", "lo", "accum");
+				: "hi", "lo");
 			cached_quotient = quotient;
 		}
 	}
@@ -389,7 +389,7 @@
 	__asm__("multu	%1,%2"
 		: "=h" (res)
 		: "r" (count), "r" (quotient)
-		: "lo", "accum");
+		: "lo");
 
 	/*
 	 * Due to possible jiffies inconsistencies, we need to check

-- 
--------------------------------------------------

Thomas Koeller, Software Development
Basler Vision Technologies

thomas dot koeller at baslerweb dot com
http://www.baslerweb.com

==============================

---

From: Richard Sandiford <[email-masked]>
Date: Tue, 27 Jul 2004 10:46:20 +0100

Thomas Koeller <[email-masked]> writes:
> Since the meaning of 'accum' used to be 'hi' and 'lo', all its uses
> were clearly redundant.

For the record, that isn't quite true.  GCC internally treated
"accum" as an entirely separate register (which is why it became
such a headache).  In theory, if you have an instruction that
clobbers lo and hi, but doesn't clobber "accum", gcc might think
that a value in "accum" will still be valid.

Richard