Re: [PATCH 1/4] Mark all member functions with memory models always inline

2013-03-20 Thread Richard Biener
On Wed, Mar 20, 2013 at 12:24 PM, Jakub Jelinek wrote: > On Wed, Mar 20, 2013 at 12:20:27PM +0100, Richard Biener wrote: >> Walking the SSA def chain would also be possible - preferably from >> cfgexpand.c when we process the stmt. But you'll eventually lose >> debug info like for >> >> int i =

Re: [PATCH 1/4] Mark all member functions with memory models always inline

2013-03-20 Thread Jakub Jelinek
On Wed, Mar 20, 2013 at 12:20:27PM +0100, Richard Biener wrote: > Walking the SSA def chain would also be possible - preferably from > cfgexpand.c when we process the stmt. But you'll eventually lose > debug info like for > > int i = 1; > __builtin_foo (i); > > when we then never expand the

Re: [PATCH 1/4] Mark all member functions with memory models always inline

2013-03-20 Thread Richard Biener
On Wed, Mar 20, 2013 at 11:46 AM, Jakub Jelinek wrote: > On Wed, Mar 20, 2013 at 11:38:03AM +0100, Richard Biener wrote: >> Not without using information created by TER which is disabled for this >> case because of different line information. If TER would not be disabled >> for this reason it wou

Re: [PATCH 1/4] Mark all member functions with memory models always inline

2013-03-20 Thread Jakub Jelinek
On Wed, Mar 20, 2013 at 11:38:03AM +0100, Richard Biener wrote: > Not without using information created by TER which is disabled for this > case because of different line information. If TER would not be disabled > for this reason it would already work automagically. Would relaxing that in TER fo

Re: [PATCH 1/4] Mark all member functions with memory models always inline

2013-03-20 Thread Richard Biener
On Tue, Mar 19, 2013 at 6:30 PM, Andi Kleen wrote: > On Tue, Mar 19, 2013 at 05:10:22PM +0100, Jakub Jelinek wrote: >> On Tue, Mar 19, 2013 at 08:51:21AM -0700, Andi Kleen wrote: >> > > Using __always_inline as the name of the macro is a bad idea, glibc >> > > headers use that macro already. Just

Re: [PATCH 1/4] Mark all member functions with memory models always inline

2013-03-19 Thread Andi Kleen
On Tue, Mar 19, 2013 at 05:10:22PM +0100, Jakub Jelinek wrote: > On Tue, Mar 19, 2013 at 08:51:21AM -0700, Andi Kleen wrote: > > > Using __always_inline as the name of the macro is a bad idea, glibc > > > headers use that macro already. Just use something else in public headers > > > that aren't p

Re: [PATCH 1/4] Mark all member functions with memory models always inline

2013-03-19 Thread Jakub Jelinek
On Tue, Mar 19, 2013 at 08:51:21AM -0700, Andi Kleen wrote: > > Using __always_inline as the name of the macro is a bad idea, glibc > > headers use that macro already. Just use something else in public headers > > that aren't part of glibc. > > That's why I had the ifdef, but ok. I'll use __forc

Re: [PATCH 1/4] Mark all member functions with memory models always inline

2013-03-19 Thread Andi Kleen
> Using __always_inline as the name of the macro is a bad idea, glibc > headers use that macro already. Just use something else in public headers > that aren't part of glibc. That's why I had the ifdef, but ok. I'll use __force_inline then. -Andi

Re: [PATCH 1/4] Mark all member functions with memory models always inline

2013-03-19 Thread Jakub Jelinek
On Mon, Mar 18, 2013 at 04:28:13PM +, Jonathan Wakely wrote: > On 16 March 2013 13:29, Andi Kleen wrote: > > > > With inline __attribute__((always_inline)) these functions > > get inlined even with -O0. > > > > I hardcoded the attribute in the header for now, assuming > > that all compilers tha

Re: [PATCH 1/4] Mark all member functions with memory models always inline

2013-03-18 Thread Jonathan Wakely
On 16 March 2013 13:29, Andi Kleen wrote: > > With inline __attribute__((always_inline)) these functions > get inlined even with -O0. > > I hardcoded the attribute in the header for now, assuming > that all compilers that support libstdc++ have attribute > always_inline too. If not it would need to

Re: [PATCH 1/4] Mark all member functions with memory models always inline

2013-03-18 Thread Jonathan Wakely
On 18 March 2013 16:28, Jonathan Wakely wrote: > On 16 March 2013 13:29, Andi Kleen wrote: >> >> With inline __attribute__((always_inline)) these functions >> get inlined even with -O0. >> >> I hardcoded the attribute in the header for now, assuming >> that all compilers that support libstdc++ have

Re: [PATCH 1/4] Mark all member functions with memory models always inline

2013-03-18 Thread Andi Kleen
On Mon, Mar 18, 2013 at 04:28:13PM +, Jonathan Wakely wrote: > On 16 March 2013 13:29, Andi Kleen wrote: > > > > With inline __attribute__((always_inline)) these functions > > get inlined even with -O0. > > > > I hardcoded the attribute in the header for now, assuming > > that all compilers tha

[PATCH 1/4] Mark all member functions with memory models always inline

2013-03-16 Thread Andi Kleen
From: Andi Kleen When a non constant memory model is passed to __atomic_* gcc falls back to seq_cst. This drops any HLE acquire or release bits. This can happen when is used with -O0 as the member functions are not always inlined then and the memory argument passed in ends up being non-constant