[llvm-bugs] [Bug 29018] New: In GetVectorElementPointer - EltSize assertions fail if getSizeInBits is less than 8

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Aug 17 09:36:57 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=29018

            Bug ID: 29018
           Summary: In GetVectorElementPointer - EltSize assertions fail
                    if getSizeInBits is less than 8
           Product: clang
           Version: 3.8
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: llvmbugs at endgame.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

The code at lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:1031 seems to have
issues if the element size is less than a full byte (e.g., processing a "i1"),
as EltSize will truncate to 0 and then the assertion will fail.  Allowing the
assertion to be ignored if EltSize == 0 seems to fix this issue, but it looks
like something that needs more review:


  // Calculate the element offset and add it to the pointer.
  unsigned EltSize = EltVT.getSizeInBits() / 8; // FIXME: should be ABI size.
  if (EltSize)
  {
    assert(EltSize * 8 == EltVT.getSizeInBits() &&
         "Converting bits to bytes lost precision");
  }

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160817/f1ee5efd/attachment.html>


More information about the llvm-bugs mailing list