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

Michael Niedermayer michaelni at gmx.at
Sat Nov 4 02:22:21 CET 2006


Hi

On Fri, Nov 03, 2006 at 08:13:37AM -0800, Trent Piepho wrote:
[...]
> 
> > Are you really seriously arguing that gcc should disable all
> > optimizations in a function if there's any asm? That it must not keep
> > variables in registers since original memory copy of the variable could
> > be changed from outside etc?
> 
> Where did I say anything like that?  I said that in order to be able to
> write atomic operations, gcc must make "m" constraints not be copies, but
> the actual variable.

no, there just needs to be any syntactical way to say "dont copy this anywhere
and give me the real location" this can be volatile or "m" or anything else,
its the decission of the compiler developers

if "m" has this additional (undocumented) constraint, its useless for anything
but spinlocks and similar, and a "m2" would be needed for normal applications


> 
> > > Did you read the same thread I did?
> > >
> > > "=m"(x) : "0"(y)  isn't allowed, as a and b can't be in the same location.
> >
> > I'm not sure exactly what you're arguing for in here and the rest of
> > your message, but I think it's not about the same thing as your original
> > disagreement with Michael.
> 
> Michael said don't use [out]"=m"(a):[in]"m"(a), use [out]"=m"(a):[in]"0"(a)
> or [inout]"+m"(a).
> 
> This is wrong.
> 
> First, the form with the "0" will not always work properly.  gcc (> ~3.5)
> will give you a warning if you even try.  

it will not give a warning on "+m" which was said to be the same as "=m"/"0"
by at least one gcc developer in the thread you linked, furthermore if gcc has 
any problems with "=m"/"0" then gcc should convert this to whatever equivalent
does not cause problems if "=m"/"0" is equivalent to "=m"/"m"in current gcc
implementations then gcc should convert it to that


> I provided a quote from a gcc
> developer about why it doesn't work properly.

i can provide you with quotes from gcc developers claiming that
finite == infinite and similar


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

[...]

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