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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

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 ([email protected]: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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to