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

Michael Niedermayer michaelni at gmx.at
Sun Nov 5 14:14:45 CET 2006


Hi

On Sat, Nov 04, 2006 at 02:37:58AM -0800, Trent Piepho wrote:
> 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.

do you know what the word "should" means? apparently not also my copy of
the docs does not have random words uppercased

info gcc-4.2 
---
The ordinary output operands must be write-only; GCC will assume that
the values in these operands before the instruction are dead and need
not be generated.  Extended asm supports input-output or read-write
operands.  Use the constraint character `+' to indicate such an operand
and list it with the output operands.  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.
---

and you cut the parts which says "The ordinary output operands must be 
write-only; GCC will assume that the values in these operands before the
instruction are dead and need not be generated."
and 
"Extended asm supports input-output or read-write operands. Use the 
constraint character `+' to indicate such an operand and list it with the
output operands."
are you trying to strengthen your point by deliberate misinterpreting
the docs and linus replies? it seems so, the docs clearly say "=m" must
be write only not that you can assume it to be read write if a matching
"m" occurs later


> 
> 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.

no "=m":"m" does not gurantee that both will be in the same spot in
memory, if your claims where correct which doesnt seems so then there
where no way left do input and output with some memory in asm

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is



More information about the MPlayer-dev-eng mailing list