This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Chain PHI nodes via separate a chain field
- From: Steven Bosscher <s dot bosscher at student dot tudelft dot nl>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: 'Andrew MacLeod ' <amacleod at redhat dot com>,'Jason Merrill ' <jason at redhat dot com>,'gcc-patches ' <gcc-patches at gcc dot gnu dot org>,'Richard Henderson ' <rth at redhat dot com>
- Date: Wed, 16 Jun 2004 21:04:40 +0200
- Subject: Re: Chain PHI nodes via separate a chain field
- References: <4195D82C2DB1D211B9910008C7C9B06F01F37462@lr0nt3.lr.tudelft.nl> <87brjjzalq.fsf@taltos.codesourcery.com>
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