This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Asm volatile causing performance regressions on ARM
- From: Pavel Fedin <p dot fedin at samsung dot com>
- To: ebotcazou at adacore dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 28 Feb 2014 09:50:33 +0400
- Subject: RE: Asm volatile causing performance regressions on ARM
- Authentication-results: sourceware.org; auth=none
- References: <02f001cf3447$b7cb7380$27625a80$%garbuzov at samsung dot com>
Hello!
> > This code (introduced in
> > http://gcc.gnu.org/viewcvs/gcc?view=revision&revision=193802) aborts
> > CSE after seeing a volatile inline asm.
>
> Note that "introduced" is not really correct here, the code had been
> there for a long time but it was treating some volatile asms as
> barriers and some others as not. Now it treats them all as barriers.
Yes, actually you are right. This behavior really was there for a while,
just triggering condition has been changed. On older gcc version we also
could reproduce this behavior by changing 'asm("":::"memory")' to
'asm("":::)' in our test example. Looks like volatile asm with empty clobber
list previously was considered even more strict than one with explicit
"memory" clobber.
So, the main question is not about triggering condition, but about the
behavior itself. Is it correct to flush and reload all constants ? They are
constants after all, they are even not stored in .data section but inlined
in the code, and thus cannot be modified.
Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia