Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

> 	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);
> 	}
> }



[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux