[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190226113008.GI32534@hirez.programming.kicks-ass.net>
Date: Tue, 26 Feb 2019 12:30:08 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: "Paul E. McKenney" <paulmck@...ux.ibm.com>
Cc: Andrea Parri <andrea.parri@...rulasolutions.com>,
linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
Alan Stern <stern@...land.harvard.edu>,
Will Deacon <will.deacon@....com>,
Boqun Feng <boqun.feng@...il.com>,
Nicholas Piggin <npiggin@...il.com>,
David Howells <dhowells@...hat.com>,
Jade Alglave <j.alglave@....ac.uk>,
Luc Maranget <luc.maranget@...ia.fr>,
Akira Yokosawa <akiyks@...il.com>,
Daniel Lustig <dlustig@...dia.com>
Subject: Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo
On Tue, Feb 26, 2019 at 12:25:21PM +0100, Peter Zijlstra wrote:
> 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 <stdio.h>
> > #include <string.h>
> > 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.
Note that gcc (as used above) was:
gcc (Debian 7.3.0-3) 7.3.0
When I used the argc variant, gcc-8 'works', but with s/argc/1/ it is
still broken.
gcc-8 (Debian 8.2.0-21) 8.2.0
gcc (Debian 7.3.0-3) 7.3.0
gcc-6 (Debian 6.4.0-12) 6.4.0 20180123
gcc-5 (Debian 5.5.0-8) 5.5.0 20171010
gcc-4.6 (Debian 4.6.3-14) 4.6.3
all generate the exact same broken crap with the '+ 1' variant.
> > 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);
> > }
> > }
Powered by blists - more mailing lists