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: [tree-ssa] Make tsi insert iterators handle chains of COMPOUND_EXPRs


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~


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