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

            Bug ID: 43638
           Summary: builtin_assume_aligned uses 32-bits for alignment
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

This test cases crashes clang, because 'unsigned' is used for the alignment,
rather than 'size_t'.

    const void * square(const void* num) {
      void* a = __builtin_assume_aligned((const void*)num, 4294967296);
      return a;
    }

Assertion:

llvm/llvm/include/llvm/IR/IRBuilder.h:2624: llvm::CallInst* llvm::IRBuilder<T,
Inserter>::CreateAlignmentAssumption(const llvm::DataLayout&, llvm::Value*,
unsigned int, llvm::Value*, llvm::Value**) [with T = llvm::ConstantFolder;
Inserter = clang::CodeGen::CGBuilderInserter]: Assertion `Alignment != 0 &&
"Invalid Alignment"' failed.

The affected functions are `EmitAlignmentAssumption` in
lib/CodeGen/CodeGenFunction.h and also `CreateAlignmentAssumption` in
include/llvm/IR/IRBuilder.h

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