[LLVMbugs] [Bug 3419] New: llc: assertion failure with i128 "Too many bits for int64_t "

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Jan 27 01:44:20 PST 2009


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

           Summary: llc: assertion failure with i128 "Too many bits for
                    int64_t"
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: edwintorok at gmail.com
                CC: llvmbugs at cs.uiuc.edu


When compiling part of LibTomMath using llvm-gcc -O1  I get a failure in
Codegen:

cc1: /home/edwin/llvm-bootstrap/llvm/include/llvm/ADT/APInt.h:1051: int64_t
llvm::APInt::getSExtValue() const: Assertion `getMinSignedBits() <= 64 && "Too
many bits for int64_t"' failed.
../../../clamav-devel/libclamav/bignum.c:9506: internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.

/* testcase */
typedef unsigned long mp_digit;
typedef unsigned long mp_word __attribute__ ((mode (TI)));
typedef struct
{
  int used, alloc, sign;
  mp_digit *dp;
}
mp_int;
int
mp_div_3 (mp_int * a, mp_int * c, mp_digit * d)
{
  mp_word w, t;
  int res, ix;
  for (ix = a->used - 1; ix >= 0; ix--)
    {
      w = (w << ((mp_word) 60)) | ((mp_word) a->dp[ix]);
      if (w >= 3)
        {
          while (w >= 3)
            {
              w -= 3;
            }
        }
    }
}

Bugpoint reduced testcase:
target datalayout =
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
target triple = "x86_64-unknown-linux-gnu"
        %struct.mp_int = type { i32, i32, i32, i64* }

define i32 @mp_div_3(%struct.mp_int* nocapture %a, %struct.mp_int* nocapture
%c, i64* nocapture %d) nounwind readonly {
entry:
        br label %bb

bb:             ; preds = %bb1, %bb, %entry
        br i1 false, label %bb1, label %bb

bb1:            ; preds = %bb1, %bb
        %indvar = phi i128 [ 0, %bb ], [ %indvar.next, %bb1 ]           ;
<i128> [#uses=2]
        %tmp = mul i128 %indvar, -3             ; <i128> [#uses=1]
        %w.17 = add i128 %tmp, 0                ; <i128> [#uses=1]
        %0 = add i128 %w.17, -3         ; <i128> [#uses=1]
        %1 = icmp ugt i128 %0, 2                ; <i1> [#uses=1]
        %indvar.next = add i128 %indvar, 1              ; <i128> [#uses=1]
        br i1 %1, label %bb1, label %bb
}


llc: /home/edwin/llvm-svn/llvm/include/llvm/ADT/APInt.h:1051: int64_t
llvm::APInt::getSExtValue() const: Assertion `getMinSig
nedBits() <= 64 && "Too many bits for int64_t"' failed.
#0  0x00007f018e79fed5 in raise () from /lib/libc.so.6
#1  0x00007f018e7a13f3 in abort () from /lib/libc.so.6
#2  0x00007f018e798dc9 in __assert_fail () from /lib/libc.so.6
#3  0x000000000083b638 in llvm::APInt::getSExtValue (this=0x353da78) at
/home/edwin/llvm-svn/llvm/include/llvm/ADT/APInt.h:10
51
#4  0x000000000083b657 in llvm::ConstantInt::getSExtValue (this=0x353da40) at
/home/edwin/llvm-svn/llvm/include/llvm/Constant
s.h:83
#5  0x0000000000f499de in CheckForIVReuse (this=0x3551a30, HasBaseReg=false,
AllUsesAreAddresses=false, AllUsesAreOutsideLoop
=false, Stride=@0x356fef0, IV=@0x7fff97ab5570, Ty=0x353ccb0,
UsersToProcess=@0x7fff97ab5610) at LoopStrengthReduce.cpp:1259
#6  0x0000000000f4c967 in StrengthReduceStridedIVUsers (this=0x3551a30,
Stride=@0x356fef0, Uses=@0x356fef8, L=0x356ebb0, isOn
lyStride=true) at LoopStrengthReduce.cpp:1487
#7  0x0000000000f4eb00 in runOnLoop (this=0x3551a30, L=0x356ebb0,
LPM=@0x3553110) at LoopStrengthReduce.cpp:2308
#8  0x0000000000fa61c8 in llvm::LPPassManager::runOnFunction (this=0x3553110,
F=@0x353d460) at LoopPass.cpp:226
#9  0x000000000104c9a1 in llvm::FPPassManager::runOnFunction (this=0x35490b0,
F=@0x353d460) at PassManager.cpp:1323
#10 0x000000000104d4e4 in llvm::FunctionPassManagerImpl::run (this=0x353e160,
F=@0x353d460) at PassManager.cpp:1281
#11 0x000000000104d642 in llvm::FunctionPassManager::run (this=0x7fff97ab5cd0,
F=@0x353d460) at PassManager.cpp:1226
#12 0x00000000008106a6 in main (argc=2, argv=0x7fff97ab5ef8) at llc.cpp:317


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