Re: gcc 4.2 miscompilation with -O2 -fno-omit-frame-pointer on amd64

2011-12-09 Thread Gleb Kurtsou
Please find test case and test results attached. (gcc-test1.shar.txt) The long story short: only gcc-4.2 is affected, gcc 3.4, 4.4 and 4.6 are ok. clang is ok. (test-cc.txt) Nearly all of the workarounds I used in original test doesn't work in this test case (see #ifdef BAD_FIX in sources). gcc

Re: gcc 4.2 miscompilation with -O2 -fno-omit-frame-pointer on amd64

2011-12-09 Thread Ryan Stone
On Fri, Dec 9, 2011 at 1:15 PM, Gleb Kurtsou wrote: > -fno-omit-frame-pointer is there for kernel debugger to be able to > generate backtraces. It's also needed by the DTrace stack() action, hwpmc callchain capture and stack(9). Disabling it as anything other than a very short-term bandaid is a

Re: gcc 4.2 miscompilation with -O2 -fno-omit-frame-pointer on amd64

2011-12-09 Thread Chris Rees
On 9 Dec 2011 17:51, "Arnaud Lacombe" wrote: > > Hi, > > On Fri, Dec 9, 2011 at 10:15 AM, Rafal Jaworowski wrote: > > > > On 2011-12-08, at 17:53, Nathan Whitehorn wrote: > > > >> On 12/08/11 03:01, Piotr Nowak wrote: > >>> We're working on PowerPC target using GCC 4.2.1 > >>> and FreeBSD 6.1. It

Re: gcc 4.2 miscompilation with -O2 -fno-omit-frame-pointer on amd64

2011-12-09 Thread Gleb Kurtsou
On (09/12/2011 16:15), Rafal Jaworowski wrote: > > On 2011-12-08, at 17:53, Nathan Whitehorn wrote: > > > On 12/08/11 03:01, Piotr Nowak wrote: > >> We're working on PowerPC target using GCC 4.2.1 > >> and FreeBSD 6.1. It seems like we have similar > >> problem. In our case GCC sometimes very unf

Re: gcc 4.2 miscompilation with -O2 -fno-omit-frame-pointer on amd64

2011-12-09 Thread Arnaud Lacombe
Hi, On Fri, Dec 9, 2011 at 10:15 AM, Rafal Jaworowski wrote: > > On 2011-12-08, at 17:53, Nathan Whitehorn wrote: > >> On 12/08/11 03:01, Piotr Nowak wrote: >>> We're working on PowerPC target using GCC 4.2.1 >>> and FreeBSD 6.1. It seems like we have similar >>> problem. In our case GCC sometime

Re: mmap implementation for cdev

2011-12-09 Thread John Baldwin
On Saturday, December 03, 2011 5:37:01 am Filippo Sironi wrote: > I need to access the memory both from user space and kernel space, I cannot do that (simply) with an mmap or thread-specific storage if I recall correctly. You could allocate a dedicated VM object for each thread's information and

Re: gcc 4.2 miscompilation with -O2 -fno-omit-frame-pointer on amd64

2011-12-09 Thread Rafal Jaworowski
On 2011-12-08, at 17:53, Nathan Whitehorn wrote: > On 12/08/11 03:01, Piotr Nowak wrote: >> We're working on PowerPC target using GCC 4.2.1 >> and FreeBSD 6.1. It seems like we have similar >> problem. In our case GCC sometimes very unfortunately >> optimize code with -fno-omit-frame-pointer. >>