lkml.org 
[lkml]   [2020]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] x86: work around clang IAS bug referencing __force_order
Date
On Thu, Aug 13 2020 at 14:09, Arvind Sankar wrote:
> On Thu, Aug 13, 2020 at 10:37:01AM -0700, Paul E. McKenney wrote:
>> > Let me ask (hopefully) useful questions this time:
>> >
>> > Is a compiler allowed to reorder two 'asm volatile()'?
>> >
>> > Are there compilers (gcc >= 4.9 or other supported ones) which do that?
>>
>> I would hope that the answer to both of these questions is "no"!
>>
>> But I freely confess that I have been disappointed before on this sort
>> of thing. :-/
>>
>> Thanx, Paul
>
> Ok, I found this, so gcc developers consider re-ordering volatile asm
> wrt each other a bug at least.
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82602

Yes. It prevents reordering of volatiles, but it does not necessarily
prevent reorder of something like this:

asm volatile(...);
foo();
asm volatile(...);

it might turn that into

foo();
asm volatile(...);
asm volatile(...);

if I understood their discussion correctly. So removing this magic is
not really straight forward.

Thanks,

tglx


\
 
 \ /
  Last update: 2020-08-20 12:48    [W:0.154 / U:1.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site