Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 06 Nov 1999 10:34:18 +0100
From:      Gary Jennejohn <garyj@peedub.muc.de>
To:        freebsd-current@freebsd.org
Subject:   Re: show stopper for Gcc 2.95.2 conversion 
Message-ID:  <199911060934.KAA00510@peedub.muc.de>
In-Reply-To: Your message of "Sat, 06 Nov 1999 16:07:06 %2B1100." <Pine.BSF.4.10.9911061555100.5557-100000@alphplex.bde.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
Bruce Evans writes:
>On Fri, 5 Nov 1999, David O'Brien wrote:
>
>> The current show stopper for switching over to GCC 2.95.2 is a problem
>> compiling the `ahc' driver:
>> 
>> cc -c -O -pipe -Wall -Wredundant-decls -Wnested-externs
>>     -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline
>>     -Wcast-qual  -fformat-extensions -ansi  -nostdinc -I- -I. -I../..
>>     -I../../../include  -DKERNEL -include opt_global.h -elf
>>     ../../dev/aic7xxx/aic7xxx.c
>> ../../dev/aic7xxx/aic7xxx.c: In function `ahc_download_instr':
>> machine/bus.h:584: Invalid `asm' statement:
>> machine/bus.h:584: fixed or forbidden register 2 (cx) was spilled for class 
>CREG.
>> *** Error code 1
>
>The asm statement is broken.  The clobber list shouldn't include any
>registers that are explicitly allocated as operands.
>

As usual, Bruce is right.

Here's a patch to bus.h which works for both EGCS and GCC 2.95.2. I have
ahc0 and ahc1 and I generated and successfully booted kernels using both
compilers with this patch.

===================== Patch =============================
--- /sys/i386/include/bus.h	Sat Aug 28 02:44:07 1999
+++ /sys/i386/include/bus.h_mod	Sat Nov  6 09:45:47 1999
@@ -260,7 +260,7 @@
 			loop 1b"				:
 		    "=&a" (__x)					:
 		    "r" (bsh + offset), "D" (addr), "c" (count)	:
-		    "%edi", "%ecx", "memory");
+		    "memory");
 	}
 #endif
 }
@@ -288,7 +288,7 @@
 			loop 1b"				:
 		    "=&a" (__x)					:
 		    "r" (bsh + offset), "D" (addr), "c" (count)	:
-		    "%edi", "%ecx", "memory");
+		    "memory");
 	}
 #endif
 }
@@ -316,7 +316,7 @@
 			loop 1b"				:
 		    "=&a" (__x)					:
 		    "r" (bsh + offset), "D" (addr), "c" (count)	:
-		    "%edi", "%ecx", "memory");
+		    "memory");
 	}
 #endif
 }
@@ -364,7 +364,7 @@
 			loop 1b"				:
 		    "=&a" (__x)					:
 		    "d" (bsh + offset), "D" (addr), "c" (count)	:
-		    "%edx", "%edi", "%ecx", "memory");
+		    "memory");
 	}
 #endif
 #if defined(_I386_BUS_MEMIO_H_)
@@ -378,7 +378,7 @@
 			movsb"					:
 								:
 		    "S" (bsh + offset), "D" (addr), "c" (count)	:
-		    "%esi", "%edi", "%ecx", "memory");
+		    "memory");
 	}
 #endif
 }
@@ -401,7 +401,7 @@
 			loop 1b"				:
 		    "=&a" (__x)					:
 		    "d" (bsh + offset), "D" (addr), "c" (count)	:
-		    "%edx", "%edi", "%ecx", "memory");
+		    "memory");
 	}
 #endif
 #if defined(_I386_BUS_MEMIO_H_)
@@ -415,7 +415,7 @@
 			movsw"					:
 								:
 		    "S" (bsh + offset), "D" (addr), "c" (count)	:
-		    "%esi", "%edi", "%ecx", "memory");
+		    "memory");
 	}
 #endif
 }
@@ -438,7 +438,7 @@
 			loop 1b"				:
 		    "=&a" (__x)					:
 		    "d" (bsh + offset), "D" (addr), "c" (count)	:
-		    "%edx", "%edi", "%ecx", "memory");
+		    "memory");
 	}
 #endif
 #if defined(_I386_BUS_MEMIO_H_)
@@ -452,7 +452,7 @@
 			movsl"					:
 								:
 		    "S" (bsh + offset), "D" (addr), "c" (count)	:
-		    "%esi", "%edi", "%ecx", "memory");
+		    "memory");
 	}
 #endif
 }
@@ -580,8 +580,7 @@
 			movb %%al,(%1)				\n\
 			loop 1b"				:
 		    "=&a" (__x)					:
-		    "r" (bsh + offset), "S" (addr), "c" (count)	:
-		    "%esi", "%ecx");
+		    "r" (bsh + offset), "S" (addr), "c" (count));
 	}
 #endif
 }
@@ -608,8 +607,7 @@
 			movw %%ax,(%1)				\n\
 			loop 1b"				:
 		    "=&a" (__x)					:
-		    "r" (bsh + offset), "S" (addr), "c" (count)	:
-		    "%esi", "%ecx");
+		    "r" (bsh + offset), "S" (addr), "c" (count));
 	}
 #endif
 }
@@ -636,8 +634,7 @@
 			movl %%eax,(%1)				\n\
 			loop 1b"				:
 		    "=&a" (__x)					:
-		    "r" (bsh + offset), "S" (addr), "c" (count)	:
-		    "%esi", "%ecx");
+		    "r" (bsh + offset), "S" (addr), "c" (count));
 	}
 #endif
 }
@@ -686,7 +683,7 @@
 			loop 1b"				:
 		    "=&a" (__x)					:
 		    "d" (bsh + offset), "S" (addr), "c" (count)	:
-		    "%edx", "%esi", "%ecx", "memory");
+		    "memory");
 	}
 #endif
 #if defined(_I386_BUS_MEMIO_H_)
@@ -700,7 +697,7 @@
 			movsb"					:
 								:
 		    "D" (bsh + offset), "S" (addr), "c" (count)	:
-		    "%edi", "%esi", "%ecx", "memory");
+		    "memory");
 	}
 #endif
 }
@@ -723,7 +720,7 @@
 			loop 1b"				:
 		    "=&a" (__x)					:
 		    "d" (bsh + offset), "S" (addr), "c" (count)	:
-		    "%edx", "%esi", "%ecx", "memory");
+		    "memory");
 	}
 #endif
 #if defined(_I386_BUS_MEMIO_H_)
@@ -737,7 +734,7 @@
 			movsw"					:
 								:
 		    "D" (bsh + offset), "S" (addr), "c" (count)	:
-		    "%edi", "%esi", "%ecx", "memory");
+		    "memory");
 	}
 #endif
 }
@@ -760,7 +757,7 @@
 			loop 1b"				:
 		    "=&a" (__x)					:
 		    "d" (bsh + offset), "S" (addr), "c" (count)	:
-		    "%edx", "%esi", "%ecx", "memory");
+		    "memory");
 	}
 #endif
 #if defined(_I386_BUS_MEMIO_H_)
@@ -774,7 +771,7 @@
 			movsl"					:
 								:
 		    "D" (bsh + offset), "S" (addr), "c" (count)	:
-		    "%edi", "%esi", "%ecx", "memory");
+		    "memory");
 	}
 #endif
 }

---
Gary Jennejohn
Home - garyj@muc.de
Work - garyj@fkr.cpqcorp.net




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199911060934.KAA00510>