Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763003AbXHKAoW (ORCPT ); Fri, 10 Aug 2007 20:44:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754956AbXHKAoH (ORCPT ); Fri, 10 Aug 2007 20:44:07 -0400 Received: from rhun.apana.org.au ([64.62.148.172]:1395 "EHLO arnor.apana.org.au" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754653AbXHKAoF (ORCPT ); Fri, 10 Aug 2007 20:44:05 -0400 Date: Sat, 11 Aug 2007 08:43:22 +0800 From: Herbert Xu To: Segher Boessenkool 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 Subject: Re: [PATCH 1/24] make atomic_read() behave consistently on alpha Message-ID: <20070811004322.GA13178@gondor.apana.org.au> References: <442f95ba19f8622ce04cf0334f34be11@kernel.crashing.org> <20070811000029.GA12779@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1066 Lines: 29 On Sat, Aug 11, 2007 at 02:38:40AM +0200, Segher Boessenkool wrote: > >>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. Do you have an example where gcc reads it non-atmoically and we care about all parts? Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt - 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/