[PATCH 1/4] Mark all member functions with memory models always inline
Richard Biener
richard.guenther@gmail.com
Wed Mar 20 11:21:00 GMT 2013
On Wed, Mar 20, 2013 at 11:46 AM, Jakub Jelinek <jakub@redhat.com> 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 would already work automagically.
>
> Would relaxing that in TER for constants help in the case of:
> static inline __attribute__((always_inline)) ...
> foo (..., int m = __ATOMIC_SEQ_CST)
> {
> if (something)
> bar ();
> else
> baz ();
> __atomic_test_and_set (&x, m);
> }
>
> void
> test ()
> {
> foo (..., __ATOMIC_HLE_ACQUIRE | __ATOMIC_SEQ_CST);
> }
> though? I'd think as the temp = 0x10005; would be in a different bb, TER
> wouldn't do anything here, for -O1 of course CCP or similar would propagate
> that, but for -O0 we'd still have to walk the chain of SSA_NAMEs.
True. I was for a long time thinking of running a CCP pass at -O0 ...
and only restrict what we sustitute into (builtin arguments and asm operands).
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 SSA name def i_2 = 1 because we are
never visiting its use ...
Richard.
> Jakub
More information about the Gcc-patches
mailing list