Bruno Haible wrote:
> Sam wrote:
>> What does this warning mean:
>> xthread.d: In function 'testandset':
>> xthread.d:393: warning: matching constraint does not allow a register
>> xthread.d:390: warning: matching constraint does not allow a register
>
> You have the gcc doc and gcc sources. What do they say about the warning?
>
> To me it looks like gcc either wants to emit a hint for optimization, or
> wants to use a register variable but is encumbered by the "=m" constraint.
> But there's nothing to optimize: A spinlock _must_ be in memory because
> the xchgl instruction only works on memory words.
spinlock appears to be a fairly generic concept.
why did you implement it yourself? (with assembly, no less!)
isn't there a library for that?
what do other MT systems use?
> Therefore I'd say you need
> to verify the .s file produced by gcc to see that gcc doesn't do unwanted
> things with the spin lock.
I don't grok assembly.
Sam.

Sam wrote:
> What does this warning mean:
> xthread.d: In function 'testandset':
> xthread.d:393: warning: matching constraint does not allow a register
> xthread.d:390: warning: matching constraint does not allow a register
You have the gcc doc and gcc sources. What do they say about the warning?
To me it looks like gcc either wants to emit a hint for optimization, or
wants to use a register variable but is encumbered by the "=m" constraint.
But there's nothing to optimize: A spinlock _must_ be in memory because
the xchgl instruction only works on memory words. Therefore I'd say you need
to verify the .s file produced by gcc to see that gcc doesn't do unwanted
things with the spin lock.
Bruno

Community

Help

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

I agree to receive quotes, newsletters and other information from sourceforge.net and its partners regarding IT services and products. I understand that I can withdraw my consent at any time. Please refer to our Privacy Policy or Contact Us for more details