Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762487AbXHKAvm (ORCPT ); Fri, 10 Aug 2007 20:51:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757318AbXHKAva (ORCPT ); Fri, 10 Aug 2007 20:51:30 -0400 Received: from gate.crashing.org ([63.228.1.57]:60345 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756584AbXHKAv3 (ORCPT ); Fri, 10 Aug 2007 20:51:29 -0400 In-Reply-To: <20070811004322.GA13178@gondor.apana.org.au> References: <442f95ba19f8622ce04cf0334f34be11@kernel.crashing.org> <20070811000029.GA12779@gondor.apana.org.au> <20070811004322.GA13178@gondor.apana.org.au> Mime-Version: 1.0 (Apple Message framework v623) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <12943ce306ab975fd589bbf5e8b14167@kernel.crashing.org> Content-Transfer-Encoding: 7bit Cc: paulmck@linux.vnet.ibm.com, heiko.carstens@de.ibm.com, horms@verge.net.au, linux-kernel@vger.kernel.org, csnook@redhat.com, rpjday@mindspring.com, netdev@vger.kernel.org, ak@suse.de, cfriesen@nortel.com, akpm@linux-foundation.org, torvalds@linux-foundation.org, jesper.juhl@gmail.com, linux-arch@vger.kernel.org, zlynx@acm.org, schwidefsky@de.ibm.com, davem@davemloft.net, wensong@linux-vs.org, wjiang@resilience.com From: Segher Boessenkool Subject: Re: [PATCH 1/24] make atomic_read() behave consistently on alpha Date: Sat, 11 Aug 2007 02:50:25 +0200 To: Herbert Xu X-Mailer: Apple Mail (2.623) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1146 Lines: 34 >>>> That means GCC cannot compile Linux; it already optimises >>>> some accesses to scalars to smaller accesses when it knows >>>> it is allowed to. Not often though, since it hardly ever >>>> helps in the cost model it employs. >>> >>> Please give an example code snippet + gcc version + arch >>> to back this up. >> >> unsigned char f(unsigned long *p) >> { >> return *p & 1; >> } > > This doesn't really matter since we only care about the LSB. It is exactly what I claimed, and what you asked proof of. > Do you have an example where gcc reads it non-atmoically and > we care about all parts? Like I explained in the original mail; no, I suspect such a testcase will be really hard to construct, esp. as a small testcase. I have no reason to believe it is impossible to do so though -- maybe someone else can write trickier code than I can, in which case, please do so. Segher - 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/