A89: Re: TI-GCC IDE issues


[Prev][Next][Index][Thread]

A89: Re: TI-GCC IDE issues




> Looking at the Automatix source, using -O2 is gonna make horrible
> performance debts.  Look at this code:
>
> void AddByteMask(byte *Ptr, byte Mask)
> {
>  *Ptr = *Ptr | Mask;
> }
>
> The compiler is actually doing this as a subroutine!  This code should
> probably be hardcoded in rather than used as a fuction, or at the very
least
> used as a macro.  But GCC isn't even inline'ing this - ouch!
>


Just a question : if you define the function with the static keyword :

static void AddByteMask(byte *Ptr, byte Mask)
{
 *Ptr = *Ptr | Mask;
}

Since it then becomes local to the current file, isn't GCC going to inline
it even with -O2 ?





References: