This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: supression of 'matching constraint does not allow a register'warning
On Fri, 30 Apr 2004 14:09:53 -0400, Daniel Jacobowitz <drow@false.org> said:
> This has been discussed at length on this list :)
Thanks, I guess I must have glossed over those.
> You can't have matching constraints for memories. Take a look at
> how libstdc++-v3 does this:
> __asm__ __volatile__ ("lock; add{l} {%1,%0|%0,%1}"
> : "=m" (*__mem) : "ir" (__val), "m" (*__mem));
> Er, except I'm not sure that's right; something was said about operands
> unreferenced in the asm text being a bad idea.
That's what I'm going with, but I wish I understood the issues better
- as you say, people have commented on this list that operands
unreferenced in the asm text aren't guaranteed to work. I've never
actually written extended asms myself (I'm just dealing with code that
somebody else wrote), so unfortunately I don't understand the
situation well enough to know whether or not I should worry about
this. :-(
David Carlton
carlton@bactrian.org