[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc
Subject:    Re: supression of 'matching constraint does not allow a register'
From:       David Carlton <carlton () bactrian ! org>
Date:       2004-04-30 18:30:56
Message-ID: yf28ygdiahr.fsf () hawaii ! kealia ! com
[Download RAW message or body]

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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic