Messages in this thread | | | From | (Linus Torvalds) | Subject | Re: linux-2.1.103 crashes egcs-19980517 on i586 | Date | 21 May 1998 21:17:05 GMT |
| |
In article <199805211906.PAA32055@sleipnir.valparaiso.cl>, Horst von Brand <vonbrand@sleipnir.valparaiso.cl> wrote: >This compiler (and egcs-19980508 at least) crash on >linux/arch/i386/kernel/bios32.c:check_pcibios. A presumably safe workaround >follows (adding __volatile__ just disallows moving the asm() around, and as >it stands, there shouldn't be any place to move it too ;-) > >Will resume the build now. > >--- linux/arch/i386/kernel/bios32.c.dist Thu May 21 11:27:05 1998 >+++ linux/arch/i386/kernel/bios32.c Thu May 21 15:00:52 1998 >@@ -543,7 +543,7 @@ > pci_indirect.address = pcibios_entry + PAGE_OFFSET; > > save_flags(flags); cli(); >- __asm__("lcall (%%edi)\n\t" >+ __asm__ __volatile__("lcall (%%edi)\n\t" > "jc 1f\n\t" > "xor %%ah, %%ah\n" > "1:"
If this patch makes any difference, the compiler is buggy.
The asm is surrounded by
cli(); .. asm .. restore_flags();
and both of those are either defined to be volatile asm's (for UP case) or to be function calls (for SMP). In either case gcc is _not_ legally supposed to move the __asm__ with the lcall around them: the lcall asm is has a "memory" modifier to mark that it can change memory.
I've added the __volatile__ to my tree because it won't hurt, but these kinds of continuing problems with egcs miscompiling the kernel make me nervous. And it makes me irritated that people _continue_ to patch the kernel instead of trying to fix the compiler.
Linus
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu
| |