[tree-ssa]: out-of-ssa breaks if something adds a pred

Daniel Berlin dberlin@dberlin.org
Fri Jun 6 20:18:00 GMT 2003


On Friday, June 6, 2003, at 04:10  PM, Andrew MacLeod wrote:

> On Fri, 2003-06-06 at 15:52, Daniel Berlin wrote:
>> When something ends up adding a predecessor block to a block with 
>> phi's
>> in it, out-of-ssa breaks.
>> This is because it expects all the phi's to have the same number of
>> args/edges as preds, but phi's created *before* the pred was added 
>> have
>> one less argument/edge.
>>
>>
>> IE into-ssa makes the following:
>> BLOCK 13, preds 2, 1
>> a_8 = PHI<a_9 (1), a_10 (2)>
>>
>> Later, an edge insertion causes the following (due to creation of a 
>> new
>> block):
>> BLOCK 13, preds 2, 1, 15
>> a_8 = PHI<a_9 (1), a_10 (2)>
>>
>> out-of-ssa will then abort eliminating the phi because it expects it 
>> to
>> have some argument associated with the edge from 15, and it doesn't.
>>
>>
>
> We always add arguments to phi when adding edges.

Call bsi_insert_edge.
Call bsi_commit_edge_insertions.
Neither adds arguments to phi's for the edges/new bb's it creates.
That's why i'm hitting this problem.

> If you are adding an edge into a PHI node, you ought to be able to
> figure out what value is coming in on the edge into the PHI.. or you 
> are
> going to have unexpected results.

I'm not adding an edge into the phi node, i'm commiting an edge 
insertion that ends up adding a bb, and thus, a new predecessor to a 
block with phi nodes in it.

In other words, it's not my fault.
I have no idea what new edge it created, and even if i did, i shouldn't 
have to figure out the new arguments to the existing phi nodes are, the 
insertion routines are.

--Dan



More information about the Gcc mailing list