basic asm and memory clobbers

Jeff Law law@redhat.com
Fri Nov 20 18:24:00 GMT 2015


On 11/20/2015 06:05 AM, Richard Henderson wrote:

>
> I'd be perfectly happy to deprecate and later completely remove basic
> asm within functions.
>
> Because IMO it's essentially useless.  It has no inputs, no outputs, and
> no way to tell the compiler what machine state has been changed.  We can
> say that "it clobbers everything", but that's not actually useful, and
> quite difficult as you're finding out.
And even more difficult to document exactly what happens, largely 
because the implementation in GCC isn't consistent across passes and 
there's differences in behaviour that are dependent on the target 
implementation as well.

Unfortunately there's not a single place where we can ensure consistent 
behaviour, so each pass has had to handle ASMs independently, and I'm 
pretty sure they all get it wrong to varying degrees.


>
> It seems to me that it would be better to remove the feature, forcing
> what must be an extremely small number of users to audit and update to
> extended asm.
That might be a little drastic.  Though if we want to go this direction, 
the first step is to deprecate for a major release cycle.  It would be 
interesting to see how much stuff would complain/break.

jeff



More information about the Gcc mailing list