[llvm-bugs] [Bug 45131] New: Large alignment assumptions overflow 32-bit 'unsigned', trip zero alignment assertion

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Mar 5 18:01:09 PST 2020


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

            Bug ID: 45131
           Summary: Large alignment assumptions overflow 32-bit
                    'unsigned', trip zero alignment assertion
           Product: clang
           Version: 9.0
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: cem at FreeBSD.org
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

Assertion failed: (Alignment != 0 && "Invalid Alignment"), function
CreateAlignmentAssumption, file llvm-project/llvm/include/llvm/IR/IRBuilder.h,
line 2573.
1.      <eof> parser at end of file
2.      Per-file LLVM IR generation
3.      ../../v8/src/common/ptr-compr-inl.h:30:19: Generating code for
declaration 'v8::internal::GetIsolateRoot'

FreeBSD clang version 9.0.1 (git at github.com:llvm/llvm-project.git
c1a0a213378a458fbea1a5c77b315c7dce08fd05) (based on LLVM 9.0.1)
Target: x86_64-unknown-freebsd13.0
Thread model: posix

This is tickled by Chrome's v8 engine, which asserts 4GB alignment with
something like:

__builtin_assume_aligned(foo, size_t{4} * GB)

in an inlined function, GetIsolateRoot().

The assertion tripped seems to be in CreateAlignmentAssumption(), which takes
an 'unsigned Alignment' and asserts it is non-zero.  2^32 mod 2^32 is zero, so
the assertion fires.  For now I am working around this issue by disabling use
of __builtin_assume_aligned() in v8.

-- 
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/20200306/e29aa9eb/attachment.html>


More information about the llvm-bugs mailing list