From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo Date: Tue, 26 Feb 2019 12:25:21 +0100 Message-ID: <20190226112521.GH32534@hirez.programming.kicks-ass.net> References: <20190220020117.GD11787@linux.ibm.com> <20190220092604.GD32494@hirez.programming.kicks-ass.net> <20190220131456.GA3215@andrea> <20190220132714.GI32494@hirez.programming.kicks-ass.net> <20190222112128.GA7213@andrea> <20190222130014.GY32494@hirez.programming.kicks-ass.net> <20190225175517.GK4072@linux.ibm.com> <20190226093009.GS32477@hirez.programming.kicks-ass.net> <20190226104551.GF32534@hirez.programming.kicks-ass.net> <20190226112133.GG32534@hirez.programming.kicks-ass.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20190226112133.GG32534@hirez.programming.kicks-ass.net> Sender: linux-kernel-owner@vger.kernel.org To: "Paul E. McKenney" Cc: Andrea Parri , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Alan Stern , Will Deacon , Boqun Feng , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , Akira Yokosawa , Daniel Lustig List-Id: linux-arch.vger.kernel.org On Tue, Feb 26, 2019 at 12:21:33PM +0100, Peter Zijlstra wrote: > Also; we need to find a GCC person to find/give us a knob to kill this > entire class of nonsense. This is just horrible broken shit: > > > ~/tmp# gcc -O2 -fno-strict-aliasing -o ptr ptr.c ; ./ptr > p=0x5635dd3d5034 q=0x5635dd3d5034 > x=1 y=2 *p=11 *q=2 > ~/tmp# cat ptr.c > #include > #include > int y = 2, x = 1; > int main (int argc, char **argv) { > int *p = &x + argc; damn; wrong version; that should've been: s/argc/1/ same result though. > int *q = &y; > printf("p=%p q=%p\n", p, q); > if (!memcmp(&p, &q, sizeof(p))) { > *p = 11; > printf("x=%d y=%d *p=%d *q=%d\n", x, y, *p, *q); > } > }