<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/153920>153920</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang][bytecode] UNREACHABLE executed in InterpBuiltinBitCast.cpp due to Unhandled bitcast type
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:frontend,
            crash,
            clang:bytecode
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          k-arrows
      </td>
    </tr>
</table>

<pre>
    Reproducer:
https://godbolt.org/z/nv596csa6
```cpp
typedef unsigned X __attribute__ ((vector_size (64)));
typedef unsigned __int128 Y __attribute__ ((vector_size (64)));

void foo (Y y)
{
  y = (X) { ~0 };
}
```

Backtrace:
```console
Unhandled bitcast type
UNREACHABLE executed at /root/llvm-project/llvm/tools/clang/lib/AST/ByteCode/InterpBuiltinBitCast.cpp:444!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -fno-verbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -fexperimental-new-constant-interpreter <source>
1.      <source>:7:1: current parser token '}'
2.      <source>:5:1: parsing function body 'foo'
3.      <source>:5:1: in compound statement ('{}')
 #0 0x00000000040213f8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x40213f8)
 #1 0x000000000401e824 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x401e824)
 #2 0x0000000003f63058 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x000074fdb4e42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x000074fdb4e969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x000074fdb4e42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x000074fdb4e287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x0000000003f6e72a (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3f6e72a)
 #8 0x0000000007afb4db bool llvm::function_ref<bool (clang::interp::Pointer const&, clang::interp::PrimType, clang::interp::Bits, clang::interp::Bits, bool)>::callback_fn<clang::interp::DoBitCastPtr(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&, clang::interp::Pointer&, unsigned long)::'lambda'(clang::interp::Pointer const&, clang::interp::PrimType, clang::interp::Bits, clang::interp::Bits, bool)>(long, clang::interp::Pointer const&, clang::interp::PrimType, clang::interp::Bits, clang::interp::Bits, bool) InterpBuiltinBitCast.cpp:0:0
 #9 0x0000000007afde27 enumerateData(clang::interp::Pointer const&, clang::interp::Context const&, clang::interp::Bits, clang::interp::Bits, llvm::function_ref<bool (clang::interp::Pointer const&, clang::interp::PrimType, clang::interp::Bits, clang::interp::Bits, bool)>) InterpBuiltinBitCast.cpp:0:0
#10 0x0000000007aff069 clang::interp::DoBitCastPtr(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Pointer const&, clang::interp::Pointer&, unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7aff069)
#11 0x00000000079c2eb1 clang::interp::EvalEmitter::emitBitCast(clang::interp::SourceInfo const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x79c2eb1)
#12 0x0000000007e25f23 clang::interp::Compiler<clang::interp::EvalEmitter>::emitBuiltinBitCast(clang::CastExpr const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7e25f23)
#13 0x0000000007e346ce clang::interp::Compiler<clang::interp::EvalEmitter>::VisitCastExpr(clang::CastExpr const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7e346ce)
#14 0x0000000007e2694d clang::interp::Compiler<clang::interp::EvalEmitter>::visitInitializer(clang::Expr const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7e2694d)
#15 0x0000000007e32c25 clang::interp::Compiler<clang::interp::EvalEmitter>::visit(clang::Expr const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7e32c25)
#16 0x0000000007e213be clang::interp::Compiler<clang::interp::EvalEmitter>::VisitVectorBinOp(clang::BinaryOperator const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7e213be)
#17 0x0000000007e358db clang::interp::Compiler<clang::interp::EvalEmitter>::VisitBinaryOperator(clang::BinaryOperator const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7e358db)
#18 0x0000000007e32b10 clang::interp::Compiler<clang::interp::EvalEmitter>::visit(clang::Expr const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7e32b10)
#19 0x0000000007e27aba clang::interp::Compiler<clang::interp::EvalEmitter>::visitExpr(clang::Expr const*, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7e27aba)
#20 0x00000000079bd381 clang::interp::EvalEmitter::interpretExpr(clang::Expr const*, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x79bd381)
#21 0x00000000079b09bf clang::interp::Context::evaluateAsRValue(clang::interp::State&, clang::Expr const*, clang::APValue&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x79b09bf)
#22 0x000000000792a3d3 EvaluateAsRValue((anonymous namespace)::EvalInfo&, clang::Expr const*, clang::APValue&) ExprConstant.cpp:0:0
#23 0x000000000792c461 clang::Expr::EvaluateForOverflow(clang::ASTContext const&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x792c461)
#24 0x0000000006927df6 clang::Sema::CheckForIntOverflow(clang::Expr const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6927df6)
#25 0x000000000695f81c clang::Sema::CheckCompletedExpr(clang::Expr*, clang::SourceLocation, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x695f81c)
#26 0x0000000006cdf917 clang::Sema::ActOnFinishFullExpr(clang::Expr*, clang::SourceLocation, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6cdf917)
#27 0x0000000006feed5e clang::Sema::ActOnExprStmt(clang::ActionResult<clang::Expr*, true>, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6feed5e)
#28 0x00000000067ec2b4 clang::Parser::ParseExprStatement(clang::Parser::ParsedStmtContext) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x67ec2b4)
#29 0x00000000067e3984 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 24u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x67e3984)
#30 0x00000000067e47c9 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 24u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x67e47c9)
#31 0x00000000067ec92b clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x67ec92b)
#32 0x00000000067ed13a clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x67ed13a)
#33 0x00000000066e334b clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66e334b)
#34 0x000000000671971d clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x671971d)
#35 0x00000000066d676e clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66d676e)
#36 0x00000000066d6f0f clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66d6f0f)
#37 0x00000000066de783 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66de783)
#38 0x00000000066df695 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66df695)
#39 0x00000000066d179a clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66d179a)
#40 0x00000000049c32f8 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x49c32f8)
#41 0x0000000004cb7355 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4cb7355)
#42 0x0000000004c335ae clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4c335ae)
#43 0x0000000004da8971 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4da8971)
#44 0x0000000000daff4f cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xdaff4f)
#45 0x0000000000da6baa ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#46 0x0000000004a2ad09 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#47 0x0000000003f634f4 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3f634f4)
#48 0x0000000004a2b31f clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#49 0x00000000049ed58d clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x49ed58d)
#50 0x00000000049ee61e clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x49ee61e)
#51 0x00000000049f60b5 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x49f60b5)
#52 0x0000000000dac405 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xdac405)
#53 0x0000000000c60394 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xc60394)
#54 0x000074fdb4e29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#55 0x000074fdb4e29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#56 0x0000000000da6655 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xda6655)
clang++: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134
```
</pre>

<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzkW11v4zbW_jXKDeFAor4vciE7cZti3jeDZLZorwyKOnK4I5NakvIkvdjfvqAoW5ZiezKtNW13iyngiF_P85zDw0OKIkqxNQe4ccK5E95ekUY_C3nzeUakFF_UVS6K15tHqKUoGgrS8TPHzZ61rpX5iZcOXq5FkYtKXwu5dvDyNwcv-TZMI6pI5LiZE7n2H61rx830aw0FlKjh7bgF-gWtVkRryfJGw2qFHJw4ONkC1UKuFPsNzJMocHDa_fPnx7pZrRjXHk7Qr7-rP8fNtoIVqBTClP-KXk2RmzmxKUXoFTn-rSn5xcEpcuI5-reLnPi2ax3fHjK1_c0J_awloWA163UQXIkKHDf7B38mvKigQDnTlCiNDC1T8P-Pd9nix2z-4Q7BC9BGQ4GIRg5eSiG0g5dVtd3Main-CXT3p4OXWohKOXhJK8KNLSqWO3iZPX1y8HL-qmEhCnDw8p5rkPW8YZVmfM70gih9bczjZ0EQONhz3Ozjh7vs6Q6pJt8wjQjKmzWSUAupkRZo5ABMPzf5NRWbHsoIIFOqAQMNEV4gxmnVFID0MyAqiXpG-V4svEC1NP5GQSkokBKNtI9NS6KUoIwYPWTDkaKS1fracbMnTehnVDSb2srtXjtu-lGKtSQbROS62QDXBrIRUdQGExWbmlUgZ_BSV0KC3Ck3I0qB1ExwNdOy4Z8dvMwZ74WdO3iOZuviC5HlLECzNZoZt1mSuja9N7pu9LVCs41RAc1mL0k0I2ozU69ckxfHv2VcQ4VmJRezLchcKDDlaPaEZrM1pTNjSPpMGHf827N4TWXFSa2ehUazkopKyFnByJoLpRlVdoxW49FjeKlBMqMKqWYcvsyMX2rC9Yy17iFBg0SOv-gM4N85buYZVQfP_Cx2_MwzwtJGSuAa1UQqkEiLz8CRg2MzO3DsuBk-0jrctTatGF-jsuHUSI9M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