https://gcc.gnu.org/bugzilla/show_bug.cgi?id=45178

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|TREE                        |
   Last reconfirmed|2021-07-26 00:00:00         |2021-8-26

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
So no, that's not the problem at all.  The only loop is the infinite while (1)
one, the problem is that because we cannot prove finiteness of the loop we're
doing

      for (auto loop : loops_list (cfun, 0))
        if (!finite_loop_p (loop))
          {
            if (dump_file)
              fprintf (dump_file, "cannot prove finiteness of loop %i\n",
loop->num);
            mark_control_dependent_edges_necessary (loop->latch, false);
          }

and that marks a condition that has nothing to do with loop control.  I suppose
we can elide this when the loop has no exit (we are already marking backedges
of irreducible loops).

But I never actually understood this particular part of CD-DCE.

The desired transform is that we end up with just

int main()
{
  while (1)
    ;
}

Reply via email to