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

Gianluigi Tiesi mplayer at netfarm.it
Sun Feb 27 11:00:20 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;

you can use different name or use unsigned int since it should be equal
to a pointer, here filterSize is an int and it's added to a pointer,
also this sum should be wrong.
Anyway this can be decared as a pointer but adding filterSize will cause
compiler to complain, but I think this can be acceptable.
> 
> 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
variable names can be changed to make it more readable
x1 can be called xInt_sh16 and x2 can be called xInt_and_ffff
> 
> 
> 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

There is no sense at all to assign a memory operand to a bit & binary
operation, since there is no memory for this value unless you don't use a variable,
I think older gcc does a similar workaround. Also note that:
dc_mask & eq_mask
will never fit in a registry on a 32bit machine since they are
declared as int64_t.
There is no advantage to retain a broken code even if it's more
readable.

-- 
Gianluigi Tiesi <sherpya at netfarm.it>
EDP Project Leader
Netfarm S.r.l. - http://www.netfarm.it/
Free Software: http://oss.netfarm.it/




More information about the MPlayer-dev-eng mailing list