This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: MEM flags and stack temps
- To: mark at codesourcery dot com (Mark Mitchell)
- Subject: Re: MEM flags and stack temps
- From: Joe Buck <jbuck at synopsys dot COM>
- Date: Wed, 15 Nov 2000 16:57:14 -0800 (PST)
- Cc: law at redhat dot com, kenner at vlsi1 dot ultra dot nyu dot edu, gcc at gcc dot gnu dot org
Mark Mitchell writes:
[ #1 deleted ]
#2:
> - Treat stack slots like registers, and allocate them in a
> "stack allocator". In other words, have (MEM (STACK_SLOT x))
> for a while, and then resolve them to hard slots late
> in the game.
>
> I actually think both approaches are good ideas. The second is
> appealing in that it helps blur the boundary between things that fit
> in a machine register, and things that don't.
Yes! With the second approach, it will then be straightforward to get rid of
the huge number of dead stores we get on C++ code (currently once an
object is assigned to the stack and we write it, the compiler is incapable
of seeing that the value is not needed). All (ok, big "all") we need to
do is extend dead code elimination to work on stack slots where addresses
are not taken (currently the dead code eliminator in dce.c believes that
all writes to memory are necessary under all conditions).