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

D Richard Felker III dalias at aerifal.cx
Sun Feb 27 00:07:39 CET 2005


On Sat, Feb 26, 2005 at 10:56:50PM +0100, Michael Niedermayer wrote:
> Hi
> 
> On Friday 25 February 2005 20:43, Gianluigi Tiesi wrote:
> > Updated patches to be compatible with gcc-2.95
> 
> > +       int ptr;
> 
> very missleading name (an integer with name ptr)
> 
> 
> > +               ptr = ((int) src) + filterSize;
> 
> u do not know if a pointer will fit in an int, if it doesnt this will fail
> 
> 
> > -               :: "r" (src), "m" (dst), "m" (dstWidth), "m" (xInc>>16), 
> "m" (xInc&0xFFFF)
> > +               :: "r" (src), "m" (dst), "m" (dstWidth), "m" (x1), "m" (x2)
> 
> this is significantly less readable, theres no hope that anyone could guess 
> from the names x1 and x2 what they are
> 
> 
> furthermore theres the fundamental question why exactly every project which 
> uses asm should rewrite their code for gcc 4, this is not about correct or 
> incorrect code, its practically just a syntax change
> the changes gcc 4 needs makes the code much harder to read, harder to optimize 
> for the compiler and much longer
> 
> is there some bugreport on gccs bugtracker about this? its breaking code which 
> was valid in the past

imo "m" is an invalid constraint for things like "(xInc>>16)" which
are not an lvalue and obviously don't have an address. apparently old
versions of gcc just ignored the "m" and treated this as "r"...or did
they have some other hack to work with it? in any case, replacing "m"
with "r" seems like the sanest alternative.

rich




More information about the MPlayer-dev-eng mailing list