[LLVMbugs] [Bug 1015] NEW: Possible bug in indvars simplify

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Nov 27 14:41:14 PST 2006


           Summary: Possible bug in indvars simplify
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Loop Optimizer
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: asl at math.spbu.ru

Consider the input file qappl.ll. Look into bb101 and next BBs. This code
corresponds to the following code in cpp (this is extract from Qt):

    for (i=0; (UINT)mouseTbl[i] != msg.message || !mouseTbl[i]; i += 3)
    if (!mouseTbl[i])
        return false;
    type = (QEvent::Type)mouseTbl[++i];
    button = mouseTbl[++i];

qappl.out.ll is output from opt -indvars. We have:

        %tmp107 = seteq uint %tmp103, %tmp106           ; <bool> [#uses=1]
        br bool %tmp107, label %cond_next109, label %bb98

cond_next109:           ; preds = %bb101
        %exitcond = setne uint %indvar, 0               ; <bool> [#uses=1]
        br bool %exitcond, label %bb98, label %bb114

%tmp103 corresponds to mouseTbl[i], %tmp106 - to msg.message. %indvar
corresponds to i/3.

Let us assume, that they equals, when i!=0. We have:

%tmp107 = true => branch to cond_next109 => %exitcond = true => branch to bb98

And we have infinite loop here :(

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

More information about the llvm-bugs mailing list