Skip to contentSkip to conversation

Fix gcc-3.4.x compilation

PATCH In review Thomas Koeller 2 participants 2 messages Jul 26, 2004 – Jul 27, 2004 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix gcc-3.4.x compilation

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.

arch/mips/kernel/time.c +4 -4
@@ -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
Signature · 9 lines
--------------------------------------------------

Thomas Koeller, Software Development
Basler Vision Technologies

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

==============================
#1 lore raw
Quoted 2 lines · Thomas Koeller

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