[tree-ssa] Insert on edge comment

Daniel Berlin dberlin@dberlin.org
Tue Jun 3 12:56:00 GMT 2003


On Tuesday, June 3, 2003, at 07:48  AM, Andrew MacLeod wrote:

> On Tue, 2003-06-03 at 01:01, Daniel Berlin wrote:
>>
>>>> Like so:
>>>>
>>>> # BLOCK 0.  PRED: -1.  SUCC: 1.
>>>>    pretmp.4_24 = in_9 + 1B; <<<<<<<<<< THIS
>>>>    while (1)
>>>>      {
>>>>>>>>>>>>> SHOULD REALLY BE HERE
>>>>        # BLOCK 1
>>>> (/compilerstuff/gcc-rw-ssa/gcc/gcc/testsuite/gcc.c-torture/execute/
>>>> 20011126-2.c:25).  PRED: 12 1 0.  SUCC: 1 2.
>>>>
>>> What I dont understand is why where it is inserted doesn't work for
>>> you?
>> Because it causes an infinite loop in this testcase?
>> :)
>>
>>> It'll be executed just before entering the loop, which is what the 
>>> edge
>>> (0,1) represents. Executed only upon entry to the loop.  You are 
>>> trying
>>> to make LOOP_EXPR more complicated than it is.
>>>
>>> BB0
>>> LOOP_EXPR
>>>    |
>>> BB1
>>>   BODY
>>>
>>> is funcationally identical to
>>>
>>> BB0
>>> goto loop_body_label;
>>> BB1
>>> loop_body_label:
>>> BODY
>>> goto loop_body_label;
>>
>>
>> The difference is that the second will cause PRE to insert in the 
>> right
>> place, and the first will not.
>> I tried it exactly as described, and get the correct result using the
>> latter form explicitly in the code, and with a while loop, it infinite
>> loops because of the placement you describe.
>> PRE doesn't know it's a LOOP_EXPR, as i mentioned.
>>
>
> Send me your testcase.
>
Coming.

> So in the second case you insert it before the goto in BB0 and that
> provides a different result than inserting it in front of the 
> LOOP_EXPR?

Exactly.
What do you think led me to believe loop_expr was special in the first 
place anyway?

--Dan



More information about the Gcc mailing list