This is the mail archive of the 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]


Richard Kenner wrote:
As near as I can tell, it's always set on a BLOCK.  So why have it in
the first place?  Am I missing something?

For ordinary BLOCKs, it will always be set. However, consider BIND_EXPR, which gets used for statement expressions and possibly also other related things. A BIND_EXPR must contain a BLOCK. TREE_USED on this BLOCK is only set when the BIND_EXPR is expanded. If TREE_USED is already set when the BIND_EXPR is expanded, then we abort. See expand_expr.

See also delete_block in the C++ front end which clears TREE_USED on a block. However, I see that delete_block is no longer used, so whatever it was doing with TREE_USED is probably not needed any more.

See also the debug info routines, which check TREE_USED before on a block before emitting debug info for it.

Now that we have functions-as-trees and tree-ssa and unit-at-a-time, maybe we don't need some of this stuff anymore. But BIND_EXPRs still work the same way they apparently always worked, which requires TREE_USED.
Jim Wilson, GNU Tools Support,

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