[tree-ssa] Make tsi insert iterators handle chains of COMPOUND_EXPRs

Richard Henderson rth@redhat.com
Thu Aug 28 20:33:00 GMT 2003


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~



More information about the Gcc-patches mailing list