This is the mail archive of the gcc-patches@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: Chain PHI nodes via separate a chain field


On Wednesday 16 June 2004 19:17, Zack Weinberg wrote:
> > So it seemed like a safer approach to just make PHI_CHAIN use a new
> > field, so that bugs show up right away.
>
> Safety is good, but bulking up memory consumption is definitely the
> wrong direction.  Can we see this ugly hack?  I wouldn't be surprised
> if it can be made nice(r) ... and I think we're going to have to go
> there eventually, if you continue with these (which I hope you do).

I already removed the hack, but basically it involves:
- creating a new #define TREE_CHECK_NOT(NODE,CODE) which aborts
  when TREE_CODE(NODE) == CODE
- cleaning up the GTY chain_{next,prev} markers from lang_tree_node
  because normally you walk the trees via their TREE_CHAIN
- re-adding those markers in tree.h to the union tree_node members
  that need it.

Note that I only did this to find the non-obvious places where
we'd walk phis via their TREE_CHAIN (I only found that one call
to nreverse).  This idea would have to be extended every time
somebody moves the chain field for another tree_node member, ie.
when decl nodes have their own chain field, you'd have to create
TREE_CHECK_NOT_2, etc.
This also makes tree checking significantly more expensive.

Gr.
Steven



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