I noticed a substantial difference between a reentrant and a vararg
function. Reentrant functions passes (with no -noregparms) the first
parameter through dpl(-dph-dpx-b) and the rest through the stack while a
vararg function passes ALL it's parameter through the stack.
I think we have a major problem here. Since there isn't a _varargs field in
struct specifier (like _reent) there is no way e.g. geniCodeParms() can
decide whether or not to _SEND_ or _PUSH_, although it will _SEND_ anyway if
the parameter is IS_REGPARM-ed, which is a BUG e.g. printf ("%d", i1*i2) :).
Adding a _varargs field in struct specifier (and initialize it in
processFuncArgs) make's it possible for geniCodeParms() to decide wheter to
_SEND_ or _PUSH_, in the case of a vararg function, however it will still
_SEND_ to reentrant functions when the parameter is IS_REGPARM-ed, which it
shouldn't, apart from the first.
My questions right now:
Is there a reason that a vararg function differs from a reentrant function.
What is the mechanism that should decide to SPEC_REGPARM() the first
parameter to a reentrant function but not the rest.