This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Memory layout (novice questions).
- To: Virgil dot Palanciuc at cs dot pub dot ro (Virgil Palanciuc)
- Subject: Re: Memory layout (novice questions).
- From: "Philippe De Muyter" <phdm at macqel dot be>
- Date: Tue, 25 Apr 2000 10:44:31 +0200 (CEST)
- Cc: mrs at windriver dot com, gcc at gcc dot gnu dot org
Virgil Palanciuc wrote :
> I don't want to do this. What I want is to implement some kind of
> optimization. As you all know, on some (most, I think) machines you can do
> loads like
> load REGx, [SP+ xxxx]
> where xxxx is an immediate value (usually a short one - on the architecture
> I am working on, I only have 5 bits available). These kind of instructions
> are used intensively to load/store local variables to/from registers.
> Of course I would like to have as much variables as possible available at
> short offsets from SP, and thus placing the shorter ones in front seems to
> be a good idea. So what I actually want to do is sort the variables by size.
Actually what you really want is to minimize the total access time (for
time-optimization) or the total instruction size (for space-optimization)
thus involving a dynamic or static access count for each stack-variable.
Philippe