This is the mail archive of the
mailing list for the GCC project.
Re: Reverse the direction of stack growth
- From: Ian Lance Taylor <iant at google dot com>
- To: PhDUCSB <eng dot hmohsen at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 12 Oct 2009 11:52:04 -0700
- Subject: Re: Reverse the direction of stack growth
- References: <email@example.com> <firstname.lastname@example.org> <email@example.com>
PhDUCSB <firstname.lastname@example.org> writes:
> Ian Lance Taylor-3 wrote:
>> PhDUCSB <email@example.com> writes:
>>> I am trying to modify the gcc backend to reverse the stack growth
>>> Do you think this is an easy task to do?
>> It kind of depends on the backend. It's easy to change what the
>> middle-end cares about--just undefine STACK_GROWS_DOWNWARD. You'll have
>> to make sure that the backend does all the right things in the function
>> prologue and epilogue code.
> Thanks for that tip. I tried doing that but the problem right now is that
> both compilers( the original and mine) produce the same executable
> regardless of any modifications I have done. I really have no clue. Please
We can't help you without a lot more information. What backend are
you using? What are you really trying to do?
The stack direction is normally built into a backend in many different
ways, so if you want to change an existing backend, you should expect
to change many different places. This is not a task to be undertaken
lightly, without a detailed knowledge of gcc backend implementations.