This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cgraph, unit-at-a-time, and the "used" attribute


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]