Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753114Ab0KOI5V (ORCPT ); Mon, 15 Nov 2010 03:57:21 -0500 Received: from sunsite.ms.mff.cuni.cz ([195.113.15.26]:39913 "EHLO sunsite.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752941Ab0KOI5T (ORCPT ); Mon, 15 Nov 2010 03:57:19 -0500 Date: Mon, 15 Nov 2010 09:56:05 +0100 From: Jakub Jelinek To: Linus Torvalds Cc: James Cloos , Linux Kernel Mailing List , Andreas Schwab , Andi Kleen , Michael Matz , Dave Korn , Richard Guenther , gcc@gcc.gnu.org, Jim Bos Subject: Re: gcc 4.5.1 / as 2.20.51.0.11 miscompiling drivers/char/i8k.c ? Message-ID: <20101115085605.GE2583@sunsite.ms.mff.cuni.cz> Reply-To: Jakub Jelinek References: <87k4kospnd.fsf@basil.nowhere.org> <877hgorrj1.fsf@basil.nowhere.org> <4CD843DC.10106@gmail.com> <20101109134816.GB29433@basil.fritz.box> <4CD97A3D.1040602@xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1777 Lines: 39 On Sun, Nov 14, 2010 at 07:21:50PM -0800, Linus Torvalds wrote: > So when Richard Gunther says "a memory clobber doesn't cover automatic > storage", to me that very clearly spells "gcc is buggy as hell". > Because automatic storage with its address taken _very_ much gets > clobbered by things like memset etc. If the compiler doesn't > understand that, the compiler is just broken. I'll leave the discussion about meaning of "memory" clobber aside to Richard, > And now, if even the (superfluous) "+m" isn't working, it sounds like > we have no sane options left. Except to say that gcc-4.5.1 is totally just to say that of course there are sane options left. :"=a"(rc), "+m" (*regs) : "a"(regs) : "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory"); is simply too high register pressure for i386 if you force also -fno-omit-frame-pointer, there is not a single register left. Yes, reload should figure out it has address of regs already tied to %eax, unfortunately starting with IRA it doesn't (I'll file a GCC bug about that; so that leaves 4.4/4.5/4.6 currently not being able to compile it). That said, changing the inline asm to just clobber one less register would be completely sufficient to make it work well with all gccs out there, just push/pop one of the register around the whole body. I doubt calling out SMM BIOS is actually so performance critical that one push and one pop would ruin it. Of course x86_64 version can stay as is, there are enough registers left... Jakub -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/