[llvm-bugs] [Bug 52012] New: __builtin_memcpy_inline crashes the compiler

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Sep 29 09:39:00 PDT 2021


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

            Bug ID: 52012
           Summary: __builtin_memcpy_inline crashes the compiler
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: joshua at froggi.es
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Created attachment 25306
  --> https://bugs.llvm.org/attachment.cgi?id=25306&action=edit
What it told me to attach.

Replacing memcpy's that have constant size with __builtin_memcpy_inline for a
JIT template causes a compiler crash.

clang-git 14.0.0.2021_08_25.1.a45d72e02-1
llvm-git 14.0.0.2021_08_25.1.a45d72e02-1
compiler-rt-git 14.0.0.2021_08_25.1.a45d72e02-1

Spew:

PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: clang -m64 -fomit-frame-pointer -ffreestanding
-fno-strict-aliasing -O3 -D_FORTIFY_SOURCE=0 -fno-stack-protector -DN_DEBUG=1
-DNDEBUG=1 -DHAVE_TIMESPEC_GET -DHAVE_PTHREAD -DUTIL_ARCH_LITTLE_ENDIAN=1
-DUTIL_ARCH_BIG_ENDIAN=0 -DRADV_DESCRIPTOR_JIT_GENERATOR=1
-I/home/joshua/Code/mesa/build/src/vulkan/util -I/usr/include/libdrm
-I../../vulkan/util -I../../../include -I../../gallium/include
-I../../amd/common -I /home/joshua/Code/mesa/build/src/compiler/nir -I ../../
-I/home/joshua/Code/mesa/build/src/amd/common
-I/home/joshua/Code/mesa/build/src/amd/vulkan -I../../vulkan/wsi -emit-llvm -o
radv_update_descriptor_set.bc -c radv_update_descriptor_set.c
1.      <eof> parser at end of file
2.      Per-file LLVM IR generation
3.      radv_update_descriptor_set.c:11:1: Generating code for declaration
'write_texel_buffer_descriptor'
 #0 0x00007f9ca4fb6c0b (/usr/bin/../lib/libLLVM-14git.so+0xbcec0b)
 #1 0x00007f9ca4fb46c5 llvm::sys::CleanupOnSignal(unsigned long)
(/usr/bin/../lib/libLLVM-14git.so+0xbcc6c5)
 #2 0x00007f9ca4eb7909 (/usr/bin/../lib/libLLVM-14git.so+0xacf909)
 #3 0x00007f9ca401fe20 __restore_rt libc_sigaction.c:0:0
 #4 0x00007f9cacec6a3e
clang::CodeGen::CodeGenModule::getNaturalPointeeTypeAlignment(clang::QualType,
clang::CodeGen::LValueBaseInfo*, clang::CodeGen::TBAAAccessInfo*)
(/usr/bin/../lib/libclang-cpp.so.14git+0x2090a3e)
 #5 0x00007f9caccc0d46
clang::CodeGen::CodeGenFunction::EmitPointerWithAlignment(clang::Expr const*,
clang::CodeGen::LValueBaseInfo*, clang::CodeGen::TBAAAccessInfo*)
(/usr/bin/../lib/libclang-cpp.so.14git+0x1e8ad46)
 #6 0x00007f9cacbf4eeb
clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(clang::GlobalDecl, unsigned
int, clang::CallExpr const*, clang::CodeGen::ReturnValueSlot)
(/usr/bin/../lib/libclang-cpp.so.14git+0x1dbeeeb)
 #7 0x00007f9caccc6bab
clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*,
clang::CodeGen::ReturnValueSlot)
(/usr/bin/../lib/libclang-cpp.so.14git+0x1e90bab)
 #8 0x00007f9cacd214a6 (/usr/bin/../lib/libclang-cpp.so.14git+0x1eeb4a6)
 #9 0x00007f9cacd1dd10
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool)
(/usr/bin/../lib/libclang-cpp.so.14git+0x1ee7d10)
#10 0x00007f9caccac260 clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr
const*, clang::CodeGen::AggValueSlot, bool)
(/usr/bin/../lib/libclang-cpp.so.14git+0x1e76260)
#11 0x00007f9caccc659f
clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*)
(/usr/bin/../lib/libclang-cpp.so.14git+0x1e9059f)
#12 0x00007f9cace3cb33 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>)
(/usr/bin/../lib/libclang-cpp.so.14git+0x2006b33)
#13 0x00007f9cace43272
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
(/usr/bin/../lib/libclang-cpp.so.14git+0x200d272)
#14 0x00007f9cace9fe67
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*)
(/usr/bin/../lib/libclang-cpp.so.14git+0x2069e67)
#15 0x00007f9caceb145a
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
(/usr/bin/../lib/libclang-cpp.so.14git+0x207b45a)
#16 0x00007f9caceefb04
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/usr/bin/../lib/libclang-cpp.so.14git+0x20b9b04)
#17 0x00007f9caceebb61
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/usr/bin/../lib/libclang-cpp.so.14git+0x20b5b61)
#18 0x00007f9cacef3b34 clang::CodeGen::CodeGenModule::EmitDeferred()
(/usr/bin/../lib/libclang-cpp.so.14git+0x20bdb34)
#19 0x00007f9cacef4fdc clang::CodeGen::CodeGenModule::Release()
(/usr/bin/../lib/libclang-cpp.so.14git+0x20befdc)
#20 0x00007f9cacf64efb (/usr/bin/../lib/libclang-cpp.so.14git+0x212eefb)
#21 0x00007f9cace9a5b5 (/usr/bin/../lib/libclang-cpp.so.14git+0x20645b5)
#22 0x00007f9caba519a9 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/bin/../lib/libclang-cpp.so.14git+0xc1b9a9)
#23 0x00007f9cad6425c9 clang::FrontendAction::Execute()
(/usr/bin/../lib/libclang-cpp.so.14git+0x280c5c9)
#24 0x00007f9cad5cc224
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/bin/../lib/libclang-cpp.so.14git+0x2796224)
#25 0x00007f9cad6c2999
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/bin/../lib/libclang-cpp.so.14git+0x288c999)
#26 0x000055dc85d6ac6e cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/bin/clang-14+0x12c6e)
#27 0x000055dc85d68249 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
driver.cpp:0:0
#28 0x00007f9cad2834a9 (/usr/bin/../lib/libclang-cpp.so.14git+0x244d4a9)
#29 0x00007f9ca4eb7a17
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/usr/bin/../lib/libLLVM-14git.so+0xacfa17)
#30 0x00007f9cad283904 (/usr/bin/../lib/libclang-cpp.so.14git+0x244d904)
#31 0x00007f9cad25588b
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
(/usr/bin/../lib/libclang-cpp.so.14git+0x241f88b)
#32 0x00007f9cad256389
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/usr/bin/../lib/libclang-cpp.so.14git+0x2420389)
#33 0x00007f9cad263bf3
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/usr/bin/../lib/libclang-cpp.so.14git+0x242dbf3)
#34 0x000055dc85d65aba main (/usr/bin/clang-14+0xdaba)
#35 0x00007f9ca400c7b3 __libc_start_call_main
/home/kevin/build/glibc-git/glibc-git/src/glibc/csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#36 0x00007f9ca400c86e __libc_start_main at GLIBC_2.2.5
/home/kevin/build/glibc-git/glibc-git/src/glibc/csu/../csu/libc-start.c:370:5
#37 0x000055dc85d67665 _start
/home/kevin/build/glibc-git/glibc-git/src/glibc/csu/../sysdeps/x86_64/start.S:118:0
clang-14: error: clang frontend command failed with exit code 139 (use -v to
see invocation)
clang version 14.0.0 (https://github.com/llvm/llvm-project.git
a45d72e0247d080eb9437736bb6cadfc27e4c065)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang-14: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-14: note: diagnostic msg: /tmp/radv_update_descriptor_set-f39d61.c
clang-14: note: diagnostic msg: /tmp/radv_update_descriptor_set-f39d61.sh
clang-14: note: diagnostic msg: 

********************

-- 
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/20210929/af13bd02/attachment.html>


More information about the llvm-bugs mailing list