[LLVMbugs] [Bug 1756] New: Casting 'constant float' to 'constant [4 x i8]' causes assertion failure.

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Oct 29 20:05:15 PDT 2007


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

           Summary: Casting 'constant float' to 'constant [4 x i8]' causes
                    assertion failure.
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: tomas.l.olsen at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Casting 'constant float' to 'constant [4 x i8]' causes assertion failure:

Assertion `SrcBitSize == DstBitSize && "BitCast requies types of same width"'
failed.

Test case:


   Constant* c = ConstantFP::get(Type::FloatTy, float(1.0));
   c = ConstantExpr::getBitCast(c, ArrayType::get(Type::Int8Ty,
gTargetData->getTypeSize(c->getType())));

gTargetData is a global created with code like:

   gTargetData = new llvm::TargetData(M);

where module M has:

   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:8"
   target triple = "x86_64-unknown-linux-gnu"

set from code.

Hope that is enough.


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