This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

problem on stack layout for variable argumentg


?Hi all,

I am recently porting GCC 4.2.0 to our private architecture, and I got
one problem on passing variable arguments on stack.

Suppose the number of argument registers is four, and it is apparent
that the fifth or more argument should be stored on stack, where I
note as the outgoing argument area. In the meanwhile, the variable
arguments, which can be determined by current_pretend_arg_size, should
also be stored on stack marked as pretend area, and in my case, these
manipulation are done at the prologue stage.

I find that these two area should stick together in the stack layout,
because when variable-argument function (e.g. printf) has more than
four argument to pass down, these argument should be then stored in a
contiguous block of memory, where the first four argument should be at
the pretend area and the others at the outgoing argument area.

My question is that, is there any mechanism that can be applied to
make these two area separated?

Thanks in advance
--
He Xiao
Shanghai Jiaotong University, 800 Dongchuang Road, Shanghai, China


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