Compiling the attached source with the following options

 -Wall -fno-exceptions -O2 -fprofile-use=/blah  -fno-rtti 

will result in a code with infinite loop.

In DCE, special code is added to handle dead loops conservatively. However this
requires PDOM information (control dep info) to be valid. The PDOM is created
in unintialized variable warning, but gets invalidated before cddce pass (the
incremental update does not work well). With the wrong CD info, DCE pass tries
to eliminate the loop, but the exit edge fixup code ends up linking the
precessor not to its post-dom bb, but to itself -- leading to infinite loop.

A proposed patch will be posted to gcc-patches.

David


-- 
           Summary: Invalid PDOM lead to infinite loop to be generated
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: davidxl at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39557

Reply via email to