This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] PHI_ARG_CAPACITY != block degree
- From: Andrew MacLeod <amacleod at redhat dot com>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Diego Novillo <dnovillo at redhat dot com>
- Date: 02 Oct 2003 19:22:57 -0400
- Subject: Re: [tree-ssa] PHI_ARG_CAPACITY != block degree
- References: <20031002214629.GA29858@atrey.karlin.mff.cuni.cz>
On Thu, 2003-10-02 at 17:46, Zdenek Dvorak wrote:
> Hello,
>
> rewrite_block assumes that PHI_ARG_CAPACITY == indegree of the block,
> which does not neccesarily have to hold if we are rerunning the
> rewrite_into_ssa; this may cause bogus entries to be created in phi
> nodes (I don't have a testcase, but it happened to me on tree-ssa-cfg).
>
Hrm. Any chance this is due to PHI_ARG_CAPACITY being bumped by 4
instead of the right size in add_phi_arg()? I can't think of any other
reason where PHI_ARG_CAPACITY woudn't equal the indegree of the block.
(except the incorrect situation of someone changing edges without
updating the PHI nodes :-)
One of the arguments to add_phi_arg is an edge. We could look at the in
degree of the destination of that edge and resize the PHI argument based
on that instead. That ought to keep things in sync and prevent us
calculating the degree every time we reenter the SSA rewriter.
We might do a couple of resizes of the same node if multiple edges and
arguments were added one at a time by someone, or if an edge were added
without being attached to the cfg yet. add_phi_arg() is only called in 2
places, and it doesnt appear to be an issue there.
If this is your problem, I'd rather do it this way. If this isn't your
problem, I'd like to know how we get to that situation.
Andrew