This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH 1/4] Mark all member functions with memory models always inline
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Andi Kleen <andi at firstfloor dot org>
- Cc: Jakub Jelinek <jakub at redhat dot com>, Andi Kleen <ak at linux dot intel dot com>, Jonathan Wakely <jwakely dot gcc at gmail dot com>, gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org, rth at redhat dot com
- Date: Wed, 20 Mar 2013 11:38:03 +0100
- Subject: Re: [PATCH 1/4] Mark all member functions with memory models always inline
- References: <1363440569-17331-1-git-send-email-andi at firstfloor dot org> <CAH6eHdR=VhEfAes6S97CfBf0Newe1h3EeoxreRKKHpi4mpJh=w at mail dot gmail dot com> <20130319064639 dot GA12913 at tucnak dot redhat dot com> <20130319155121 dot GM19692 at tassilo dot jf dot intel dot com> <20130319161022 dot GE12913 at tucnak dot redhat dot com> <20130319173016 dot GF20853 at two dot firstfloor dot org>
On Tue, Mar 19, 2013 at 6:30 PM, Andi Kleen <andi@firstfloor.org> 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 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.
>>
>> I'd say Jonathan's _GLIBCXX_ALWAYS_INLINE would be better.
>>
>> BTW, have you verified always_inline works fine for -O0?
>
> I did some simple tests and it seemed to work.
>
> But thanks for the counter example.
>
>>
>> with -O0 -mhle doesn't result in xacquire, guess for !optimize
>> get_memmodel would need to look through chain of SSA_NAMEs if SSA_NAME
>> (that can appear because of inlining), looking for INTEGER_CSTs.
>
> interesting. so need more fixes. i'll look into that. Is there
> already a convenient helper for it?
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.
Eventually we can relax this restriction for constants that are only fed
through temporaries ...
> There was an alternative approach of using a template, but I suppose
> that would have the same problem.
Possibly yes, but I guess the frontend substitutes without going through
an extra temporary (if all arguments are template parameters!)
Richard.
>
> -Andi