This is the mail archive of the ecos-discuss@sourceware.cygnus.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: CYG_INSTRUMENT_CLOCK+PowerPC+FPU problem.


Jesper Skov <jskov@redhat.com> writes:
[...]
> I just had an idea. Maybe we could change the CYG_UNUSED_PARAM to:
>
> #define CYG_UNUSED_PARAM(_type_, _var_) \
>     if (0) { if ((_var_) == (_var_)); }
>
> That would always work without any overhead, wouldn't it?

Only if optimization is turned on ;-)

This also requires _type_ to have operator '==' (not the case for structs).

The obvious replacement

if (0) { (_var_) = (_var_); }

will sometimes emit floating point instructions on the PPC that in turn may
cause (while probability is very low) saving/restoring of FP registers in the
function prologue/epilogue :-(

I still think that it's better to don't use CYG_UNUSED_PARAM inside macros.

Sergei.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]