<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Clang 7.0: crash compiling C++17"
   href="https://bugs.llvm.org/show_bug.cgi?id=39851">39851</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang 7.0: crash compiling C++17
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>7.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>merlin.nimier@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=21182" name="attach_21182" title="Crash reproducer run script">attachment 21182</a> <a href="attachment.cgi?id=21182&action=edit" title="Crash reproducer run script">[details]</a></span>
Crash reproducer run script

Attached: run script.
Due to attachement size limit, the pre-processed source is available at:
<a href="https://drive.google.com/file/d/1HRPD-gvtsuXKKTkoI5ozfGcvBvj9QnYy/view?usp=sharing">https://drive.google.com/file/d/1HRPD-gvtsuXKKTkoI5ozfGcvBvj9QnYy/view?usp=sharing</a>


The compiler was being run on a Skylake X CPU, on source making use of AVX512
intrinsics (potentially including some of the newer instruction sets).



Clang crash messages:


```
FAILED: src/libcore/CMakeFiles/mitsuba-core-obj.dir/spectrum.cpp.o
/home/merlin/Code/llvm/build/bin/clang++  -DLITTLE_ENDIAN
-DMTS_BUILD_MODULE=MTS_MODULE_CORE -DMTS_ENABLE_PROFILER -DSINGLE_PRECISION
-D__LINUX__ -I/usr/include/libcxxabi -I../include -I../ext/tinyformat
-I../ext/nanogui/ext/eigen -I../ext/enoki/include -I../ext/tbb/include
-I../ext/pybind11/include -I/usr/include/python3.6m -I../ext/asmjit/src
-I../ext/nanogui/include -I../ext/nanogui/ext/glfw/include
-I../ext/nanogui/ext/nanovg/src -I../ext/pugixml/src
-I../ext/openexr/IlmBase/Imath -I../ext/openexr/IlmBase/Iex
-I../ext/openexr/IlmBase/Half -I../ext/openexr/OpenEXR/IlmImf
-Iext_build/openexr/OpenEXR/config -Iext_build/openexr/IlmBase/config
-stdlib=libc++ -D_LIBCPP_VERSION -std=c++17 -fcolor-diagnostics -O3 -DNDEBUG
-fPIC   -fno-stack-protector -fomit-frame-pointer -fno-math-errno
-ffp-contract=fast -march=native -Wall -Wextra -Wdouble-promotion
-fvisibility=hidden -mllvm -x86-use-vzeroupper=0 -MD -MT
src/libcore/CMakeFiles/mitsuba-core-obj.dir/spectrum.cpp.o -MF
src/libcore/CMakeFiles/mitsuba-core-obj.dir/spectrum.cpp.o.d -o
src/libcore/CMakeFiles/mitsuba-core-obj.dir/spectrum.cpp.o -c
../src/libcore/spectrum.cpp
clang-7: ../tools/clang/lib/CodeGen/TargetInfo.cpp:2960: llvm::Type *(anonymous
namespace)::X86_64ABIInfo::GetByteVectorType(clang::QualType) const: Assertion
`(Size == 128 || Size == 256 || Size == 512) && "Invalid type found!"' failed.
Stack dump:
0.      Program arguments: /home/merlin/Code/llvm/build/bin/clang-7 -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name
spectrum.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix
-ffp-contract=fast -masm-verbose -mconstructor-aliases -munwind-tables
-fuse-init-array -target-cpu skylake-avx512 -target-feature +sse2
-target-feature +cx16 -target-feature +sahf -target-feature -tbm
-target-feature -avx512ifma -target-feature -sha -target-feature -gfni
-target-feature -fma4 -target-feature -vpclmulqdq -target-feature +prfchw
-target-feature +bmi2 -target-feature -cldemote -target-feature +fsgsbase
-target-feature -ptwrite -target-feature +xsavec -target-feature +popcnt
-target-feature +aes -target-feature -avx512bitalg -target-feature -movdiri
-target-feature +xsaves -target-feature -avx512er -target-feature -avx512vnni
-target-feature -avx512vpopcntdq -target-feature -pconfig -target-feature +clwb
-target-feature +avx512f -target-feature -clzero -target-feature -pku
-target-feature +mmx -target-feature -lwp -target-feature -rdpid
-target-feature -xop -target-feature +rdseed -target-feature -waitpkg
-target-feature -movdir64b -target-feature -sse4a -target-feature +avx512bw
-target-feature +clflushopt -target-feature +xsave -target-feature -avx512vbmi2
-target-feature +avx512vl -target-feature +invpcid -target-feature +avx512cd
-target-feature +avx -target-feature -vaes -target-feature +rtm -target-feature
+fma -target-feature +bmi -target-feature +rdrnd -target-feature -mwaitx
-target-feature +sse4.1 -target-feature +sse4.2 -target-feature +avx2
-target-feature -wbnoinvd -target-feature +sse -target-feature +lzcnt
-target-feature +pclmul -target-feature -prefetchwt1 -target-feature +f16c
-target-feature +ssse3 -target-feature -sgx -target-feature -shstk
-target-feature +cmov -target-feature -avx512vbmi -target-feature +movbe
-target-feature +xsaveopt -target-feature +avx512dq -target-feature +adx
-target-feature -avx512pf -target-feature +sse3 -dwarf-column-info
-debugger-tuning=gdb -momit-leaf-frame-pointer -coverage-notes-file
/home/merlin/Code/mitsuba2-bis/build/src/libcore/CMakeFiles/mitsuba-core-obj.dir/spectrum.cpp.gcno
-resource-dir /home/merlin/Code/llvm/build/lib/clang/7.0.1 -dependency-file
src/libcore/CMakeFiles/mitsuba-core-obj.dir/spectrum.cpp.o.d -sys-header-deps
-MT src/libcore/CMakeFiles/mitsuba-core-obj.dir/spectrum.cpp.o -D LITTLE_ENDIAN
-D MTS_BUILD_MODULE=MTS_MODULE_CORE -D MTS_ENABLE_PROFILER -D SINGLE_PRECISION
-D __LINUX__ -I /usr/include/libcxxabi -I ../include -I ../ext/tinyformat -I
../ext/nanogui/ext/eigen -I ../ext/enoki/include -I ../ext/tbb/include -I
../ext/pybind11/include -I /usr/include/python3.6m -I ../ext/asmjit/src -I
../ext/nanogui/include -I ../ext/nanogui/ext/glfw/include -I
../ext/nanogui/ext/nanovg/src -I ../ext/pugixml/src -I
../ext/openexr/IlmBase/Imath -I ../ext/openexr/IlmBase/Iex -I
../ext/openexr/IlmBase/Half -I ../ext/openexr/OpenEXR/IlmImf -I
ext_build/openexr/OpenEXR/config -I ext_build/openexr/IlmBase/config -D
_LIBCPP_VERSION -D NDEBUG -internal-isystem /usr/include/c++/v1
-internal-isystem /usr/local/include -internal-isystem
/home/merlin/Code/llvm/build/lib/clang/7.0.1/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -O3 -Wall -Wextra -Wdouble-promotion
-std=c++17 -fdeprecated-macro -fdebug-compilation-dir
/home/merlin/Code/mitsuba2-bis/build -ferror-limit 19 -fmessage-length 0
-fvisibility hidden -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-mllvm -x86-use-vzeroupper=0 -o
src/libcore/CMakeFiles/mitsuba-core-obj.dir/spectrum.cpp.o -x c++
../src/libcore/spectrum.cpp -faddrsig
1.      ../src/libcore/spectrum.cpp:91:56: current parser token ';'
2.      ../src/libcore/spectrum.cpp:3:1
<Spelling=../include/mitsuba/core/platform.h:4:33>: parsing namespace 'mitsuba'
3.      ../include/mitsuba/core/spectrum.h:124:30: instantiating function
definition 'mitsuba::cie1931_xyz<mitsuba::Spectrum<float>,
mitsuba::Spectrum<float> >'
4.      ../include/mitsuba/core/spectrum.h:124:30: LLVM IR generation of
declaration 'mitsuba::cie1931_xyz'
5.      ../include/mitsuba/core/spectrum.h:124:30: Generating code for
declaration 'mitsuba::cie1931_xyz'
#0 0x0000000002086514 PrintStackTraceSignalHandler(void*)
(/home/merlin/Code/llvm/build/bin/clang-7+0x2086514)
#1 0x000000000208429e llvm::sys::RunSignalHandlers()
(/home/merlin/Code/llvm/build/bin/clang-7+0x208429e)
#2 0x00000000020866d2 SignalHandler(int)
(/home/merlin/Code/llvm/build/bin/clang-7+0x20866d2)
#3 0x00007f391fd88dd0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12dd0)
#4 0x00007f391f442077 gsignal
/build/glibc-B9XfQf/glibc-2.28/signal/../sysdeps/unix/sysv/linux/internal-signals.h:84:10
#5 0x00007f391f423535 abort /build/glibc-B9XfQf/glibc-2.28/stdlib/abort.c:81:7
#6 0x00007f391f42340f get_sysdep_segment_value
/build/glibc-B9XfQf/glibc-2.28/intl/loadmsgcat.c:509:8
#7 0x00007f391f42340f __tls_get_addr
/build/glibc-B9XfQf/glibc-2.28/intl/loadmsgcat.c:970:34
#8 0x00007f391f433142 (/lib/x86_64-linux-gnu/libc.so.6+0x32142)
#9 0x00000000023c1ed5 (/home/merlin/Code/llvm/build/bin/clang-7+0x23c1ed5)
#10 0x00000000023bd6e3 (anonymous
namespace)::X86_64ABIInfo::computeInfo(clang::CodeGen::CGFunctionInfo&) const
(/home/merlin/Code/llvm/build/bin/clang-7+0x23bd6e3)
#11 0x0000000002436a51
clang::CodeGen::CodeGenTypes::arrangeLLVMFunctionInfo(clang::CanQual<clang::Type>,
bool, bool, llvm::ArrayRef<clang::CanQual<clang::Type> >,
clang::FunctionType::ExtInfo,
llvm::ArrayRef<clang::FunctionProtoType::ExtParameterInfo>,
clang::CodeGen::RequiredArgs)
(/home/merlin/Code/llvm/build/bin/clang-7+0x2436a51)
#12 0x0000000002436ea7 arrangeLLVMFunctionInfo(clang::CodeGen::CodeGenTypes&,
bool, llvm::SmallVectorImpl<clang::CanQual<clang::Type> >&,
clang::CanQual<clang::FunctionProtoType>, clang::FunctionDecl const*)
(/home/merlin/Code/llvm/build/bin/clang-7+0x2436ea7)
#13 0x0000000002439395
clang::CodeGen::CodeGenTypes::arrangeFunctionDeclaration(clang::FunctionDecl
const*) (/home/merlin/Code/llvm/build/bin/clang-7+0x2439395)
#14 0x000000000230ad7d
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/home/merlin/Code/llvm/build/bin/clang-7+0x230ad7d)
#15 0x0000000002304255
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/home/merlin/Code/llvm/build/bin/clang-7+0x2304255)
#16 0x000000000230e560
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*)
(/home/merlin/Code/llvm/build/bin/clang-7+0x230e560)
#17 0x0000000002a90e20 (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
(/home/merlin/Code/llvm/build/bin/clang-7+0x2a90e20)
#18 0x0000000002a8e27b
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef)
(/home/merlin/Code/llvm/build/bin/clang-7+0x2a8e27b)
#19 0x0000000003b3dc5b
clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation,
clang::FunctionDecl*, bool, bool, bool)
(/home/merlin/Code/llvm/build/bin/clang-7+0x3b3dc5b)
#20 0x0000000003a55eb9 clang::Sema::ActOnExplicitInstantiation(clang::Scope*,
clang::SourceLocation, clang::SourceLocation, clang::Declarator&)
(/home/merlin/Code/llvm/build/bin/clang-7+0x3a55eb9)
#21 0x00000000032b6bdc
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*)
(/home/merlin/Code/llvm/build/bin/clang-7+0x32b6bdc)
#22 0x00000000032b7cb8
clang::Parser::ParseDeclarationAfterDeclarator(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&)
(/home/merlin/Code/llvm/build/bin/clang-7+0x32b7cb8)
#23 0x000000000332f5f3
clang::Parser::ParseSingleDeclarationAfterTemplate(clang::DeclaratorContext,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier)
(/home/merlin/Code/llvm/build/bin/clang-7+0x332f5f3)
#24 0x000000000332e3c3
clang::Parser::ParseExplicitInstantiation(clang::DeclaratorContext,
clang::SourceLocation, clang::SourceLocation, clang::SourceLocation&,
clang::ParsedAttributes&, clang::AccessSpecifier)
(/home/merlin/Code/llvm/build/bin/clang-7+0x332e3c3)
#25 0x000000000332e276
clang::Parser::ParseDeclarationStartingWithTemplate(clang::DeclaratorContext,
clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier)
(/home/merlin/Code/llvm/build/bin/clang-7+0x332e276)
#26 0x00000000032b15b4
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&)
(/home/merlin/Code/llvm/build/bin/clang-7+0x32b15b4)
#27 0x000000000329a613
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (/home/merlin/Code/llvm/build/bin/clang-7+0x329a613)
#28 0x00000000032c8777
clang::Parser::ParseInnerNamespace(std::vector<clang::SourceLocation,
std::allocator<clang::SourceLocation> >&, std::vector<clang::IdentifierInfo*,
std::allocator<clang::IdentifierInfo*> >&, std::vector<clang::SourceLocation,
std::allocator<clang::SourceLocation> >&, unsigned int, clang::SourceLocation&,
clang::ParsedAttributes&, clang::BalancedDelimiterTracker&)
(/home/merlin/Code/llvm/build/bin/clang-7+0x32c8777)
#29 0x00000000032c822e clang::Parser::ParseNamespace(clang::DeclaratorContext,
clang::SourceLocation&, clang::SourceLocation)
(/home/merlin/Code/llvm/build/bin/clang-7+0x32c822e)
#30 0x00000000032b1620
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&)
(/home/merlin/Code/llvm/build/bin/clang-7+0x32b1620)
#31 0x000000000329a613
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (/home/merlin/Code/llvm/build/bin/clang-7+0x329a613)
#32 0x0000000003299e2a
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/home/merlin/Code/llvm/build/bin/clang-7+0x3299e2a)
#33 0x0000000003295887 clang::ParseAST(clang::Sema&, bool, bool)
(/home/merlin/Code/llvm/build/bin/clang-7+0x3295887)
#34 0x000000000270e3b0 clang::FrontendAction::Execute()
(/home/merlin/Code/llvm/build/bin/clang-7+0x270e3b0)
#35 0x00000000026b8431
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/merlin/Code/llvm/build/bin/clang-7+0x26b8431)
#36 0x00000000027b0766
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/merlin/Code/llvm/build/bin/clang-7+0x27b0766)
#37 0x00000000008e8013 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/merlin/Code/llvm/build/bin/clang-7+0x8e8013)
#38 0x00000000008e6195 main (/home/merlin/Code/llvm/build/bin/clang-7+0x8e6195)
#39 0x00007f391f42509b __libc_start_main
/build/glibc-B9XfQf/glibc-2.28/csu/../csu/libc-start.c:308:16
#40 0x00000000008e331a _start
(/home/merlin/Code/llvm/build/bin/clang-7+0x8e331a)
clang-7: error: unable to execute command: Aborted (core dumped)
clang-7: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 7.0.1 (<a href="http://llvm.org/git/clang">http://llvm.org/git/clang</a>
64485e37ac4b73bdf0b1834164dee90f7cae2eea) (<a href="http://llvm.org/git/llvm.git">http://llvm.org/git/llvm.git</a>
5993754bccbfd2e500ba7747841eb169d41512b2)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/merlin/Code/llvm/build/bin
clang-7: note: diagnostic msg: PLEASE submit a bug report to
<a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash backtrace, preprocessed source,
and associated run script.
clang-7: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-7: note: diagnostic msg: /tmp/spectrum-a2bb07.cpp
clang-7: note: diagnostic msg: /tmp/spectrum-a2bb07.sh
clang-7: note: diagnostic msg:

********************
```



Please let me know if I can provide any more information.
Best regards,
Merlin</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>