On 04/24/2018 07:21 AM, Michael Matz wrote: > Hi, > > On Tue, 24 Apr 2018, Alexander Monakov wrote: > >>> Sure but even for that we need to decide if we want to go that or the >>> opposite way, and that's not easy when a deadline is lurking behind >>> you. >> >> I am surprised there is any question. Even gcc-3.4 optimizes reg vars >> over asms, on a testcase not unlike the very one you've used I see: > > Thanks for checking. Seems all the code that was supposed to care for > enabling this was always incomplete since a long time, which certainly > speaks for going the explicit dependency way. The very nature of a traditional asm implies that it can read or write anything visible to compiler. We can't realistically peek inside to see what's happening and the user hasn't provided appropriate dataflow information. One could make the argument that traditional asms should go the way of the dodo bird. I think we looked at that not terribly long ago, but didn't really get anywhere.
Unfortunately doing the conservative thing and exposing the full set of dependency edges to give the natural semantics of a traditional asm has badly broken stuff in the past. I doubt the change to IRA/LRA has really changed this situation. So what we've done is paper over these issues time and again to try and preserve the expected semantics of a traditional asm. I wonder if we should bite the bullet and try again to deprecate traditional asms. Jeff