This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: cgraph, unit-at-a-time, and the "used" attribute
- From: "Daniel Berlin" <dberlin at dberlin dot org>
- To: "Gary Funck" <gary at intrepid dot com>
- Cc: "GCC List" <gcc at gcc dot gnu dot org>
- Date: Sun, 7 Oct 2007 10:35:00 -0400
- Subject: Re: cgraph, unit-at-a-time, and the "used" attribute
- References: <20071007024859.GG9118@intrepid.com>
On 10/6/07, Gary Funck <gary@intrepid.com> wrote:
> I'm also not certain why DECL_PRESERVE_P() was introduced
> when TREE_USED() seems to imply the same thing (that the
> variable/function is used and shouldn't be eliminated.
Because it doesn't mean that.
"/* Nonzero in a _DECL if the name is used in its scope.
...
#define TREE_USED(NODE) ((NODE)->base.used_flag)
"
This is completely unrelated to whether a variable must be preserved.
>
> I was surprised that the call graph code to check for
> variable usage isn't better isolated and modularized.
> It seems out of place in c-decl.c for example.
It was written at a time when this was the way you had to do things.
These days, it probably could be a lot cleaner.