lkml.org 
[lkml]   [2021]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC] LKMM: Add volatile_if()
    On Sat, Jun 05, 2021 at 09:29:03PM -0400, Alan Stern wrote:
    > Interesting. And changing one of the branches from barrier() to __asm__
    > __volatile__("nop": : :"memory") also causes a branch to be emitted. So
    > even though the compiler doesn't "look inside" assembly code, it does
    > compare two pieces at least textually and apparently assumes if they are
    > identical then they do the same thing.

    And that is a simple fact, since the same assembler code (at the same
    spot in the program) will do the same thing no matter how that ended up
    there.

    And the compiler always is allowed to duplicate, join, delete, you name
    it, inline assembler code. The only thing that it cares about is
    semantics of the code, just like for any other code.


    Segher

    \
     
     \ /
      Last update: 2021-06-06 13:59    [W:4.599 / U:0.376 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site