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]

Re: Updating the CFG on the fly?


Jeffrey A Law writes:
 >   In message <14376.59362.865480.164820@ongaonga.elec.canterbury.ac.nz>you writ
 > e:
 > Right.  So the question is does this actually happen in normal code.  rth
 > and I were discussing this today; we both think it should be rare, but we
 > could be wrong.

Yes, it can occur when we have nested natural loops sharing the same
loop header.  I've got a testcase for this but do not yet have a good
idea of how common this occurs.

     |
+-->(2)<--+
|__/  \   |
      (3) |
       |  |
      (4)-+

 > The transformation you're suggesting is going to add an additional branch on
 > the path which continues the loop -- probably not a particularly
 > wise idea.

I had envisaged that the jump optimiser would fix this up once the
loop had been optimised.

 > [ I'm assuming that your cfg left out the loop exit from nodes 3 & 4.

Yes, the CFG gets a bit cluttered otherwise...

Michael.



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