This is the mail archive of the gcc@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] Insert on edge comment



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.




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