This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: basic asm and memory clobbers

On Tue, Nov 17, 2015 at 02:31:29PM -0700, Jeff Law wrote:
> >- There is a plausible work-around with extended asm, which (mostly) has
> >clear semantics regarding clobbers.
> Converting an old-style asm to extended asm can be painful.  ANd in the 
> case of legacy code the conversion process itself is a potential source 
> of bugs.

> >- While the change probably won't introduce bad code, if it does it will
> >be in ways that are going to be difficult to track down, in an area
> >where few have the expertise to debug.
> >- Existing code that currently does things 'right' (ie push/pop any
> >modified registers) will suddenly be doing things 'wrong,' or at least
> >wastefully.

Basic asm does not do this, and hasn't for a very long time.  So there
simply cannot be existing users that rely on this behaviour.  fwprop1
removes the save/restore already, in most cases.

> The fact that it wasn't documented that way eons ago is simply a 
> documentation bug -- likely due to the fact that back when the 
> documentation for traditional asms was written, there were virtually no 
> optimizations of memory referencing instructions -- essentially folks 
> didn't ponder (much less document) how these asms would interact with 
> memory.

_Does_ basic asm as currently implemented have a memory clobber?  If not,
it seems we can just remove basic asm completely and everything would
still work the same!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]