[MPlayer-dev-eng] Improved remove-logo filter

Trent Piepho xyzzy at speakeasy.org
Sat Nov 4 11:37:58 CET 2006


On Sat, 4 Nov 2006, Michael Niedermayer wrote:
> so to summarize, please correct me if iam wrong
> "=m"/"m" works best on most gcc versions according to you, it according
> to you and one gcc developer is guranteed to have both pointing to the same
> spot in memory while nothing? in the gcc docs would support such a view and
> consequently according to the docs has undefined bahavior
>
> so until the gcc docs contain a gurantee that "=m"(a)/"m"(a) will always
> point to the same spot in memory, i assume that this is not guranteed
> yes the official docs are more authorative then 2 random people
> and so code which depends on such assumtations is consequently buggy and
> rejected
> if your claim is really true please bug the gcc devels to add that to the
> docs or point me to the part of the docs which confirm your claim

I looks like you didn't notice this bit in the gcc 4.1.1 docs:

	Use the constraint character `+' to indicate [a read-write
	operand].  You should ONLY use read-write operands when the
	constraints for the operand (or the operand in which only some of
	the bits are to be changed) ALLOW A REGISTER.

The docs say, only use "+" with constraints that allow a register, which
obviously means don't use it with "m"!  So the "+m" form is out, the docs
(and the various other things I've pointed out) say so.

If you use "=m":"0", you get a warning:
void foo(void) { int x; asm("# %0":"=m"(x):"0"(x)); }
test.c:1: warning: matching constraint does not allow a register

So that form is out, gcc is telling you it doesn't like it.

What does that leave?  The only thing left is "=m":"m", which is what I've
been saying all along.



More information about the MPlayer-dev-eng mailing list