[llvm-bugs] [Bug 48169] New: Non-Type Template Parameter Passed to Function By Value Crash

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 13 05:31:34 PST 2020


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

            Bug ID: 48169
           Summary: Non-Type Template Parameter Passed to Function By
                    Value Crash
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: v at nametag.social
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

took a guess as this being the right place to report this. And if you switch
the compiler to GCC you can see this works on GCC.

https://godbolt.org/z/bMT5qx

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:
/opt/compiler-explorer/clang-trunk-20201113/bin/clang-12 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj --mrelax-relocations -disable-free
-disable-llvm-verifier -discard-value-names -main-file-name example.cpp
-mrelocation-model static -mframe-pointer=none -fmath-errno -fno-rounding-math
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic
-fno-split-dwarf-inlining -debug-info-kind=limited -dwarf-version=4
-debugger-tuning=gdb -resource-dir
/opt/compiler-explorer/clang-trunk-20201113/lib/clang/12.0.0 -internal-isystem
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/11.0.0/../../../../include/c++/11.0.0
-internal-isystem
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/11.0.0/../../../../include/c++/11.0.0/x86_64-linux-gnu
-internal-isystem
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/11.0.0/../../../../include/c++/11.0.0/backward
-internal-isystem /usr/local/include -internal-isystem
/opt/compiler-explorer/clang-trunk-20201113/lib/clang/12.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O3
-Wno-gnu-string-literal-operator-template -std=gnu++2a -fdeprecated-macro
-fdebug-compilation-dir /home/ce -ferror-limit 19 -fgnuc-version=4.2.1
-fcxx-exceptions -fexceptions -fcolor-diagnostics -vectorize-loops
-vectorize-slp -faddrsig -o /tmp/example-116b3f.o -x c++ <source> 
1.      <eof> parser at end of file
2.      Per-file LLVM IR generation
3.      <source>:75:31: Generating code for declaration 'Formatter::forward'
 #0 0x00005640224ab1ec llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/opt/compiler-explorer/clang-trunk-20201113/bin/clang-12+0x2de41ec)
 #1 0x00005640224a8f84 llvm::sys::RunSignalHandlers()
(/opt/compiler-explorer/clang-trunk-20201113/bin/clang-12+0x2de1f84)
 #2 0x00005640224a90f3 SignalHandler(int)
(/opt/compiler-explorer/clang-trunk-20201113/bin/clang-12+0x2de20f3)
 #3 0x00007f0e0c3623c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #4 0x0000564021e0ac31 llvm::Value::stripPointerCasts() const
(/opt/compiler-explorer/clang-trunk-20201113/bin/clang-12+0x2743c31)
 #5 0x0000564022757ebd
clang::CodeGen::CGDebugInfo::CollectTemplateParams(clang::TemplateParameterList
const*, llvm::ArrayRef<clang::TemplateArgument>, llvm::DIFile*)
(/opt/compiler-explorer/clang-trunk-20201113/bin/clang-12+0x3090ebd)
 #6 0x0000564022759a88
clang::CodeGen::CGDebugInfo::collectFunctionDeclProps(clang::GlobalDecl,
llvm::DIFile*, llvm::StringRef&, llvm::StringRef&, llvm::DIScope*&,
llvm::MDTupleTypedArrayWrapper<llvm::DINode>&, llvm::DINode::DIFlags&)
(/opt/compiler-explorer/clang-trunk-20201113/bin/clang-12+0x3092a88)
 #7 0x000056402275ff69
clang::CodeGen::CGDebugInfo::EmitFunctionStart(clang::GlobalDecl,
clang::SourceLocation, clang::SourceLocation, clang::QualType, llvm::Function*,
bool, clang::CodeGen::CGBuilderTy&)
(/opt/compiler-explorer/clang-trunk-20201113/bin/clang-12+0x3098f69)
 #8 0x00005640227d831d
clang::CodeGen::CodeGenFunction::StartFunction(clang::GlobalDecl,
clang::QualType, llvm::Function*, clang::CodeGen::CGFunctionInfo const&,
clang::CodeGen::FunctionArgList const&, clang::SourceLocation,
clang::SourceLocation)
(/opt/compiler-explorer/clang-trunk-20201113/bin/clang-12+0x311131d)
 #9 0x00005640227dc981
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
(/opt/compiler-explorer/clang-trunk-20201113/bin/clang-12+0x3115981)
#10 0x000056402281ef68
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*)
(/opt/compiler-explorer/clang-trunk-20201113/bin/clang-12+0x3157f68)
#11 0x000056402281cee4
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*)
(/opt/compiler-explorer/clang-trunk-20201113/bin/clang-12+0x3155ee4)
#12 0x000056402282372a clang::CodeGen::CodeGenModule::EmitDeferred()
(/opt/compiler-explorer/clang-trunk-20201113/bin/clang-12+0x315c72a)
#13 0x0000564022823b5c clang::CodeGen::CodeGenModule::Release()
(/opt/compiler-explorer/clang-trunk-20201113/bin/clang-12+0x315cb5c)
#14 0x00005640232b4607 (anonymous
namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&)
(/opt/compiler-explorer/clang-trunk-20201113/bin/clang-12+0x3bed607)
#15 0x00005640232b25c5
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/opt/compiler-explorer/clang-trunk-20201113/bin/clang-12+0x3beb5c5)
#16 0x000056402417ddf9 clang::ParseAST(clang::Sema&, bool, bool)
(/opt/compiler-explorer/clang-trunk-20201113/bin/clang-12+0x4ab6df9)
#17 0x0000564022cc3131 clang::FrontendAction::Execute()
(/opt/compiler-explorer/clang-trunk-20201113/bin/clang-12+0x35fc131)
#18 0x0000564022c7bbbb
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/opt/compiler-explorer/clang-trunk-20201113/bin/clang-12+0x35b4bbb)
#19 0x0000564022d8a93b
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/opt/compiler-explorer/clang-trunk-20201113/bin/clang-12+0x36c393b)
#20 0x00005640205c81fc cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/opt/compiler-explorer/clang-trunk-20201113/bin/clang-12+0xf011fc)
#21 0x00005640205c48dd ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/opt/compiler-explorer/clang-trunk-20201113/bin/clang-12+0xefd8dd)
#22 0x00005640204f731a main
(/opt/compiler-explorer/clang-trunk-20201113/bin/clang-12+0xe3031a)
#23 0x00007f0e0be130b3 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x270b3)
#24 0x00005640205c445a _start
(/opt/compiler-explorer/clang-trunk-20201113/bin/clang-12+0xefd45a)
clang-12: error: unable to execute command: Segmentation fault (core dumped)
clang-12: error: clang frontend command failed due to signal (use -v to see
invocation)
Compiler returned: 254

-- 
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/20201113/894a349b/attachment-0001.html>


More information about the llvm-bugs mailing list