This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: random thought - optimizer
- To: Joern Rennecke <amylaar at redhat dot com>
- Subject: Re: random thought - optimizer
- From: law at redhat dot com
- Date: Tue, 03 Jul 2001 08:35:24 -0700
- cc: mark at codesourcery dot com (Mark Mitchell), zackw at stanford dot edu (Zack Weinberg), gcc at gcc dot gnu dot org (gcc at gcc dot gnu dot org)
- Reply-To: law at redhat dot com
In message <200107030016.f630GdP28825@phal.cambridge.redhat.com>you write:
> Not quite. You would also have to account for the difference between
> static and auto variables.
> I.e. arrange for the return value to be used in the exit block,
Yes.
> and add an edge from the exit block to the entry block, where all
No. This is unnecessary.
It's probably worth your time to read some literature on more aggressive
dead code elimination algorithms.
If/when there's a way to tell that a MEM is local to a procedure, then it
is trivial for our SSA DCE optimizer to remove loads/stores to that variable
if they do not contribute to the externally visible result of the program.
jeff