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]

Re: Issue with allocating stack space to local variables (frame pointer)


Ian,

Thanks for your quick reply.
In our case inorder to push some value onto the stack , it place the value into the location pointed by stack pointer first and then decrement/increment the stack pointer (post operation).
jump to sub- routine & return instructions are implemented using above method.
Initially our stack is bottom-up stack,currently we want to change it to top-down stack.
Is it possible to do this in compiler with out changing our ISA( instruction set architecture).


Thanks & regards,
Siva Prasad.

Ian Lance Taylor wrote:
"Sivaprasad.pv" <sivaprasad.pv@redpinesignals.com> writes:

We are trying to port gnu gcc for our custom processor. But it is
giving problem for allocating stack to local (auto) variables.
for example:
I declared local variable in following order.
int a, b, c;
char d;
short e, f, g;
char h;
while allocating stack to these local variable it is leaving space
which is equal to the size of that data type.

That sounds like exactly what it is supposed to do, so I think you need to explain in more detail.


I have tried to adjust by defining "STARTING_FRAME_OFFSET" macro.But
I am unable to get required results.

Setting STARTING_FRAME_OFFSET to any value other than zero is almost certainly wrong. If you are looking at STARTING_FRAME_OFFSET, you should probably instead look at INITIAL_ELIMINATION_OFFSET.

Ian





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