[MPlayer-dev-eng] [PATCH] Disable additional optimization if compiler doesn't support __attribute__((used))

Zuxy Meng zuxy.meng at gmail.com
Sun Jun 10 19:06:56 CEST 2007


Hi,

2007/6/10, Michael Niedermayer <michaelni at gmx.at>:
> Hi
>
> On Sun, Jun 10, 2007 at 11:04:26AM +0200, Reimar Doeffinger wrote:
> > Hello,
> > On Sun, Jun 10, 2007 at 04:56:47PM +0800, Zuxy Meng wrote:
> > [...]
> > > Just curious, why use attribute_used and the MANGLE macro instead of
> > > mentioning such variables to a constraint? For gcc 2.95 compatibility?
> >
> > Because that makes it even more likely that the compiler will not be
> > able to compile it because it claims to be out of registers.
> > There is one piece of asm code that has 8 "m" constraints, all global
> > array with fixed address, but still ICC 9.1 could not compile it because
> > it tried to use a register for each!!!!!!
> > Or IOW: I see this breaking more than it will fix.
>
> you can add a seperate asm (or c code) which refers to the used variable
> or maybe just defining attribute used to volatile would work?
>
> (no iam not arguing in favor of commiting (global) int used=a+b+c; hacks)
>
> or if all attribute used are also static then we could
>
> #define attribute_used static attriute(used)
> #else
> #define attribute_used
>
> icc likely cant remove global vars ...

Hmm...IIRC icc supports global interprocedure optimization. Don't know
what'll happen to those global vars.
-- 
Zuxy
Beauty is truth,
While truth is beauty.
PGP KeyID: E8555ED6



More information about the MPlayer-dev-eng mailing list