[MPlayer-dev-eng] [PATCH] fixes for gcc4

Michael Niedermayer michaelni at gmx.at
Mon Feb 28 13:35:24 CET 2005


Hi

On Monday 28 February 2005 06:24, D Richard Felker III wrote:
> On Mon, Feb 28, 2005 at 04:42:06AM +0100, Michael Niedermayer wrote:
> > > > > There is no advantage to retain a broken code even if it's more
> > > > > readable.
> > > >
> > > > please elaborate about why it is broken in your oppinion
> > >
> > > a binary and over two vars has not a memory location then has not an
> > > lvalue to put in asm code, I'm not the only that says this, if you
> > > disagree complain to gcc developers... :)
> >
> > "m" is NOT an output, its an input only constraint, "=m" would be an
> > output, so IMO theres no need for it to be a lvalue
> >
> > if it where "=m" then your argument is certainly true and it would have
> > to be an lvalue ...
>
> imo it does make sense to require an lvalue. "m" is the inline-asm
> equivalent of the & (address of) operator in c, and thus it makes

IMO "m" is not the equivalent of address of, if it where this would have very 
serious consequences
there are 2 possibilities, either the compiler is able to copy a value onto 
the stack and access it via esp/ebp or it is not able to do
the (address of) equivalently would mean no copy to stack, but this would make 
it practically impossible for gcc to solve the register assignment, as the 
copy to stack is needed as a fallback if gcc runs out of registers, yes i 
know this is exactly what happens, as gcc never copies a variable from memory 
to a different location


furtermore "m" can and is often not a single register but 
base+index*scale+offset style address, this really isnt equivalent of an 
(address of) operator, IMO "g"(&foobar) would be, though that would need to 
be written as
void *dummy= &foobar;
 ... "g"(dummy)

now with latest and greatest gcc

[...]
-- 
Michael

"nothing is evil in the beginning. Even Sauron was not so." -- Elrond




More information about the MPlayer-dev-eng mailing list