https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66754

--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> ---
Doc says:

Using the built-in functions described below, you can record the
arguments a function received, and call another function with the same
arguments, without knowing the number or types of the arguments.

 You can also record the return value of that function call, and later
return that value, without knowing what data type the function tried to
return (as long as your caller expects that data type).

 However, these built-in functions may interact badly with some
sophisticated features or other extensions of the language.  It is,
therefore, not recommended to use them outside very simple functions
acting as mere forwarders for their arguments.

We have

extern void foo (char *name, double d, double e, double f, int g);

void
bar (char *name, ...)
{
  __builtin_apply(foo, __builtin_apply_args(), 64);
}

calling foo with bar's arguments won't work for IA MCU since all bar's
arguments are passed on stack and some foo's arguments are passed in
registers.

Reply via email to