[LLVMbugs] [Bug 957] NEW: Predicate simplifier causes libgcc/_udivdi3_s miscompilation

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Oct 19 11:33:02 PDT 2006


           Summary: Predicate simplifier causes libgcc/_udivdi3_s
           Product: libraries
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Scalar Optimizations
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: evan.cheng at apple.com

Without predsimplify pass:

LBB1_18:        #cond_false179
        testl %ebp, %ebp
        jne LBB1_20     #cond_next185
LBB1_19:        #cond_true182
        movl $1, %eax
        xorl %edx, %edx
        divl %ebp
        movl %eax, %ebp
LBB1_20:        #cond_next185
        cmpl $65535, %ebp
        ja LBB1_24      #cond_false199

The divl is properly guarded to prevent divide by zero.

With -predsimplify:

LBB1_25:        #cond_true182
        xorl %edx, %edx
        movl $1, %eax
        divl %edx
        movl %eax, %ebp
LBB1_26:        #cond_next185
        cmpl $65535, %ebp
        ja LBB1_30      #cond_false199

That's guaranteed to cause an divide by zero exception!

------- 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