This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Make tsi insert iterators handle chains of COMPOUND_EXPRs
- From: Richard Henderson <rth at redhat dot com>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: gcc-patches at gcc dot gnu dot org, amacleod at redhat dot com, law at redhat dot com
- Date: Thu, 28 Aug 2003 13:33:36 -0700
- Subject: Re: [tree-ssa] Make tsi insert iterators handle chains of COMPOUND_EXPRs
- References: <20030828195323.GA19202@atrey.karlin.mff.cuni.cz>
On Thu, Aug 28, 2003 at 09:53:23PM +0200, Zdenek Dvorak wrote:
> if (mode == TSI_SAME_STMT)
> ! i->tp = &(TREE_OPERAND (*last, 1));
> ! else if (mode == TSI_NEW_STMT)
> ! i->tp = last != &t ? last : i->tp;
[...]
> if (mode == TSI_NEW_STMT)
> i->tp = &(TREE_OPERAND (*(i->tp), 1));
> + else if (mode == TSI_CHAIN_END)
> + i->tp = last != &t ? last : &(TREE_OPERAND (*(i->tp), 1));
Correct me if I'm wrong. It appears as if in the first case
TSI_NEW_STMT leaves the pointer at the end of the chain that
we inserted, and the second case leaves the pointer at the
beginning.
If I'm right, I'd like to see this corrected. In particular,
I think it would make most sense to have
TSI_SAME_STMT duh
TSI_NEW_STMT At the head of the chain insertted,
TSI_CHAIN_END At the end of the chain insertted; in the case
of insertting a single stmt, this degenerates
to be the same as TSI_NEW_STMT.
r~