[tree-ssa] Insert on edge comment

Daniel Berlin dberlin@dberlin.org
Tue Jun 3 05:03:00 GMT 2003


>> 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.




More information about the Gcc mailing list