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

    <tr>
        <th>Summary</th>
        <td>
            llvm/lib/IR/Instructions.cpp:3061: static llvm::BinaryOperator* llvm::BinaryOperator::Create(llvm::Instruction::BinaryOps, llvm::Value*, llvm::Value*, const llvm::Twine&, llvm::Instruction*): Assertion `S1->getType() == S2->getType() && "Cannot create binary operator with two operands of differing type!"' failed.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          wierton
      </td>
    </tr>
</table>

<pre>
    When compiling the code below with `clangtk -O0`, an assertion failure is triggered by `clangtk`.
```
#include <x86intrin.h>

int a = 0;
int __attribute__((__vector_size__(8))) b;

void bar(void) {
 b *= __builtin_ia32_vec_init_v2si(0, a);
}
```

clang's output:
```
clang: /root/llvm-project/llvm/lib/IR/Instructions.cpp:3061: static llvm::BinaryOperator* llvm::BinaryOperator::Create(llvm::Instruction::BinaryOps, llvm::Value*, llvm::Value*, const llvm::Twine&, llvm::Instruction*): Assertion `S1->getType() == S2->getType() && "Cannot create binary operator with two operands of differing type!"' failed.
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 -S --gcc-toolchain=/opt/compiler-explorer/gcc-9.2.0 -fcolor-diagnostics -fno-crash-diagnostics -O0 <source>
1.      <eof> parser at end of file
2.      <source>:6:6: LLVM IR generation of declaration 'bar'
3.      <source>:6:6: Generating code for declaration 'bar'
 #0 0x000055e93c31a1df llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3bb41df)
 #1 0x000055e93c317f4c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3bb1f4c)
 #2 0x000055e93c261658 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x00007fc3312a5420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x00007fc330d7200b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
 #5 0x00007fc330d51859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
 #6 0x00007fc330d51729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
 #7 0x00007fc330d62fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
 #8 0x000055e93bc33f35 (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x34cdf35)
 #9 0x000055e93bc41af4 (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x34dbaf4)
#10 0x000055e939d81593 llvm::IRBuilderBase::CreateMul(llvm::Value*, llvm::Value*, llvm::Twine const&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x161b593)
#11 0x000055e93ca3bf3b (anonymous namespace)::ScalarExprEmitter::EmitMul((anonymous namespace)::BinOpInfo const&) CGExprScalar.cpp:0:0
#12 0x000055e93ca53e31 (anonymous namespace)::ScalarExprEmitter::EmitCompoundAssignLValue(clang::CompoundAssignOperator const*, llvm::Value* ((anonymous namespace)::ScalarExprEmitter::*)((anonymous namespace)::BinOpInfo const&), llvm::Value*&) (.constprop.0) CGExprScalar.cpp:0:0
#13 0x000055e93ca54837 (anonymous namespace)::ScalarExprEmitter::EmitCompoundAssign(clang::CompoundAssignOperator const*, llvm::Value* ((anonymous namespace)::ScalarExprEmitter::*)((anonymous namespace)::BinOpInfo const&)) (.constprop.0) CGExprScalar.cpp:0:0
#14 0x000055e93ca47284 clang::StmtVisitorBase<std::add_pointer, (anonymous namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) CGExprScalar.cpp:0:0
#15 0x000055e93ca4e4e4 clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x42e84e4)
#16 0x000055e93c9e1b6e clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x427bb6e)
#17 0x000055e93ca03ecb clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x429decb)
#18 0x000055e93c6491a7 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3ee31a7)
#19 0x000055e93c64fde4 clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3ee9de4)
#20 0x000055e93c6afe2a clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3f49e2a)
#21 0x000055e93c6c3c3f clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3f5dc3f)
#22 0x000055e93c727c39 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3fc1c39)
#23 0x000055e93c722bc5 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3fbcbc5)
#24 0x000055e93c723798 clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3fbd798)
#25 0x000055e93c72c6a3 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (.part.0) CodeGenModule.cpp:0:0
#26 0x000055e93d5651b6 (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) ModuleBuilder.cpp:0:0
#27 0x000055e93d5556e0 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4def6e0)
#28 0x000055e93ea5e184 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x62f8184)
#29 0x000055e93d561f78 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4dfbf78)
#30 0x000055e93cdbbea9 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4655ea9)
#31 0x000055e93cd40e46 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x45dae46)
#32 0x000055e93ce9ed26 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4738d26)
#33 0x000055e9397dff5c cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x1079f5c)
#34 0x000055e9397dbc7a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#35 0x000055e93cba7d7d 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
#36 0x000055e93c261b60 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3afbb60)
#37 0x000055e93cba85ff 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
#38 0x000055e93cb6fbfc clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4409bfc)
#39 0x000055e93cb7068d 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+0x440a68d)
#40 0x000055e93cb7876d clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x441276d)
#41 0x000055e9397de1da clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x10781da)
#42 0x000055e9396e5215 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xf7f215)
#43 0x00007fc330d53083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#44 0x000055e9397d6a5e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x1070a5e)
clang: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWltv2zgW_jXKC2FDInV9yIPjJt0OOmjRFJ1Hg5cjh1uZFEgqTfbXLyjJjqjaaZLxLGaxCyROTJGH5_vOhUckqbVyqwAuo-wqyt5d0M7daXP5Q4JxWl0wLR4v_7gDhbjetbKRaovcHSCuBSAGjf6Bfkh3h6I85g1VW_cdLT7FUR5HeI2oQtRaME5qhWoqm84AkhY5I7dbMCAQe5yMjPJ4GcXvonjlxw8_w1dMpOJNJwBFZP1Q5l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