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

Daniel Berlin dberlin@dberlin.org
Sun Oct 7 14:35:00 GMT 2007


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.



More information about the Gcc mailing list