This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Dead-code elimination can't remove string copy insns?
- From: law at redhat dot com
- To: Diego Novillo <dnovillo at redhat dot com>
- Cc: Zack Weinberg <zack at codesourcery dot com>, Michael Matz <matz at suse dot de>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Tue, 13 May 2003 12:02:05 -0600
- Subject: Re: Dead-code elimination can't remove string copy insns?
- Reply-to: law at redhat dot com
In message <1052848240.27232.407.camel@frodo.toronto.redhat.com>, Diego Novillo
writes:
>On Tue, 2003-05-13 at 13:38, law@redhat.com wrote:
>
>> Does this look better? :-)
>>
>Much :)
>
>Now, if we could also get rid of those pesky labels. You mentioned
>something about that, but I forget what.
Well, it's simply a matter of building a use count for the labels. As
we remove GOTO_EXPRs we decrement the count. If the count goes to zero
and the label is not special (such as the target of a nonlocal goto), then
the label is unused and can be eliminated.
There's nothing particularly tricky here except that we want to build
those use counts efficiently. Meaning we don't want a separate walk
over the tree structures merely to build the use counts.
It's on the TODO, but it hasn't bubbled up to the top yet. Removal
of unused variables is a much bigger win as far as compilation time
is concerned.
Jeff