[LLVMbugs] [Bug 13615] New: APInt::udivrem says 1/1 == -1

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Aug 15 15:46:01 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=13615

             Bug #: 13615
           Summary: APInt::udivrem says 1/1 == -1
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Support Libraries
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: hfinkel at anl.gov
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Using r161995:

APInt a(32, 1), b(32, 1), c, d;
APInt::udivrem(a, b, c, d);
dbgs() << "dividing " << a << " by " << b << " yields " << c << " rem " << d <<
"\n";

prints:

dividing 1 by 1 yields -1 rem 0

Using sdivrem does not seem to help. Unless I'm missing something, 1/1 != -1.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list