[LLVMbugs] [Bug 7848] New: Non trivial vectors crash the JIT with invalid alignment calculation

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Aug 9 08:17:48 PDT 2010


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

           Summary: Non trivial vectors crash the JIT with invalid
                    alignment calculation
           Product: new-bugs
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: ddneff at hotmail.com
                CC: llvmbugs at cs.uiuc.edu


Vectors with alignments over 255 bytes will crash the JIT as a result of trying
to allocate a huge amount of memory (as a result of doing a 0 - 1).  I'm using
<26 x double>, but anything that returns an alignment that doesn't fit inside
of an unsigned char will have problems.  I believe this started in change
102206, which changed TargetData::getAlignmentInfo to return alignments over
255 for vectors.  Unfortunately, TargetData::getAlignment uses this function,
but only returns an unsigned char, not an unsigned int.  This results in the
alignment getting truncated (to 0 in my case), and really bad things resulting.

unsigned char TargetData::getAlignment(const Type *Ty, bool abi_or_pref) const;

unsigned TargetData::getAlignmentInfo(AlignTypeEnum AlignType, 
                                      uint32_t BitWidth, bool ABIInfo,
                                      const Type *Ty) const;

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