[llvm-bugs] [Bug 41831] New: Assertion failed: N1.getValueType() == N2.getValueType() && N1.getValueType() == VT && "Binary operator types must match!"

via llvm-bugs llvm-bugs at lists.llvm.org
Fri May 10 07:26:53 PDT 2019


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

            Bug ID: 41831
           Summary: Assertion failed: N1.getValueType() ==
                    N2.getValueType() && N1.getValueType() == VT &&
                    "Binary operator types must match!"
           Product: clang
           Version: 6.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: kukoba.anton at apriorit.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

Created attachment 21917
  --> https://bugs.llvm.org/attachment.cgi?id=21917&action=edit
bitcode

I've hit the subj assertion, compiling the bitcode in attach. I've tried to add
some logs and investigate what is the problem.

The assertion:

assert(N1.getValueType() == N2.getValueType() && N1.getValueType() == VT &&
           "Binary operator types must match!");

The failing instruction in bitcode seems to be this:

  %370 = mul i32 %369, %369
  %371 = mul i32 %370, 863
  %372 = and i32 %359, 7     <<<<<<<<<<<<<<< assert here
  %373 = or i32 %372, 6
  %374 = mul i32 %373, %373
  %375 = mul i32 %374, 191

Where %359 is:

%359 = call i32 @llvm.objectsize.i32.p0i8(i8* %.reload239, i1 false, i1 true)

At the assertion moment we've got:

N1 = "t82: i64 = Constant<-1>"
N2 = "t149: i32 = Constant<7>"

It seems %359 contains i64 -1 but it should be i32.

PS: I used 6.0.0 release but it seems 8.0.0 has the same issue

command line:

clang -target x86_64 -c origa.ll

stack call:

Assertion failed: N1.getValueType() == N2.getValueType() && N1.getValueType()
== VT && "Binary operator types must match!", file
z:\s\git\llvm-project\llvm\lib\codegen\selectiondag\selectiondag.cpp, line 4373
Wrote crash dump file "C:\Users\User\AppData\Local\Temp\clang.exe-634dba.dmp"
0x02D58729 (0x00000016 0x3D1689EF 0x0910CFE4 0x0910CAAC), HandleAbort() + 0x9
bytes(s), z:\s\git\llvm-project\llvm\lib\support\windows\signals.inc, line 411
0x5945F3A8 (0x00000016 0x014710D1 0x0910CA48 0x59464F7D), raise() + 0x368
bytes(s)
0x59460902 (0x000000D1 0x000000D1 0x00000058 0x00730041), abort() + 0x32
bytes(s)
0x59464F7D (0x07F3FB10 0x07F3FA58 0x00001115 0xCCCCCCCC),
_get_wide_winmain_command_line() + 0x1D3D bytes(s)
0x59464C59 (0x07F3FB10 0x07F3FA58 0x00001115 0x00000001),
_get_wide_winmain_command_line() + 0x1A19 bytes(s)
0x594632EA (0x07F3FB10 0x07F3FA58 0x00001115 0x03CA5E88),
_get_wide_winmain_command_line() + 0xAA bytes(s)
0x5946528A (0x07F3FB10 0x07F3FA58 0x00001115 0x0910D088), _wassert() + 0x1A
bytes(s)
0x03CA5E88 (0x0910D030 0x00000076 0x0910D018 0xCCCCCC06),
llvm::SelectionDAG::getNode() + 0x398 bytes(s),
z:\s\git\llvm-project\llvm\lib\codegen\selectiondag\selectiondag.cpp, line 4372
+ 0x78 byte(s)
0x03D0B6A5 (0x136CAFD8 0x00000076 0x172F2E60 0x0910D0B0),
llvm::SelectionDAGBuilder::visitBinary() + 0x235 bytes(s),
z:\s\git\llvm-project\llvm\lib\codegen\selectiondag\selectiondagbuilder.cpp,
line 2734 + 0x4B byte(s)
0x03D6AF6C (0x136CAFD8 0x00000019 0x172F2E60 0x0910D0CC),
llvm::SelectionDAGBuilder::visitAnd() + 0x1C bytes(s),
z:\s\git\llvm-project\llvm\lib\codegen\selectiondag\selectiondagbuilder.h, line
855 + 0x1C byte(s)
0x03D02F5F (0x0000001A 0x136CAFD8 0xCCCCCCCC 0x136CAFD8),
llvm::SelectionDAGBuilder::visit() + 0x1FF bytes(s),
z:\s\git\llvm-project\llvm\include\llvm\ir\instruction.def, line 145 + 0xC
byte(s)
0x03D02CFD (0x136CAFD8 0xCCCCCCCC 0xCCCCCCCC 0xCCCCCCCC),
llvm::SelectionDAGBuilder::visit() + 0x8D bytes(s),
z:\s\git\llvm-project\llvm\lib\codegen\selectiondag\selectiondagbuilder.cpp,
line 1057
0x03D72CC1 (0x13374FE4 0x137A6FE8 0x0910D1EF 0x0910DB30),
llvm::SelectionDAGISel::SelectBasicBlock() + 0x91 bytes(s),
z:\s\git\llvm-project\llvm\lib\codegen\selectiondag\selectiondagisel.cpp, line
659
0x03D728A7 (0x14234FAC 0x0910DBE0 0x0910DB4C 0xCCCCCCCC),
llvm::SelectionDAGISel::SelectAllBasicBlocks() + 0xF97 bytes(s),
z:\s\git\llvm-project\llvm\lib\codegen\selectiondag\selectiondagisel.cpp, line
1632
0x03D6BCD7 (0x15054E40 0x11AACF50 0x0910DB74 0x01DD665B),
llvm::SelectionDAGISel::runOnMachineFunction() + 0x4C7 bytes(s),
z:\s\git\llvm-project\llvm\lib\codegen\selectiondag\selectiondagisel.cpp, line
470
0x0162B31B (0x15054E40 0x0910DB80 0xCCCCCCCC 0xCCCCCCCC), `anonymous
namespace'::X86DAGToDAGISel::runOnMachineFunction() + 0x2B bytes(s),
z:\s\git\llvm-project\llvm\lib\target\x86\x86iseldagtodag.cpp, line 176
0x01DD665B (0x14234FAC 0x0910DC1C 0x0910DC28 0x00000000),
llvm::MachineFunctionPass::runOnFunction() + 0x15B bytes(s),
z:\s\git\llvm-project\llvm\lib\codegen\machinefunctionpass.cpp, line 62 + 0x13
byte(s)
0x023712F5 (0x14234FAC 0x0910DCD4 0x00000000 0x14234FAC),
llvm::FPPassManager::runOnFunction() + 0x105 bytes(s),
z:\s\git\llvm-project\llvm\lib\ir\legacypassmanager.cpp, line 1520 + 0x17
byte(s)
0x0237149A (0x13E28D80 0x0910DD18 0x0910DCE0 0x00000000),
llvm::FPPassManager::runOnModule() + 0x7A bytes(s),
z:\s\git\llvm-project\llvm\lib\ir\legacypassmanager.cpp, line 1541 + 0x10
byte(s)
0x023724D0 (0x13E28D80 0x0910DFFC 0x0910E008 0x00F50000), `anonymous
namespace'::MPPassManager::runOnModule() + 0x1C0 bytes(s),
z:\s\git\llvm-project\llvm\lib\ir\legacypassmanager.cpp, line 1597 + 0x17
byte(s)
0x02372B8A (0x13E28D80 0x0910DE28 0x0910DFFC 0x032E5D79),
llvm::legacy::PassManagerImpl::run() + 0xFA bytes(s),
z:\s\git\llvm-project\llvm\lib\ir\legacypassmanager.cpp, line 1700 + 0x1B
byte(s)
0x0236D35D (0x13E28D80 0x0910E178 0x0910E008 0xCCCCCCCC),
llvm::legacy::PassManager::run() + 0x1D bytes(s),
z:\s\git\llvm-project\llvm\lib\ir\legacypassmanager.cpp, line 1732
0x032E5D79 (0x00000005 0x13DFEFC0 0x0910E22C 0x0910E1A0), `anonymous
namespace'::EmitAssemblyHelper::EmitAssembly() + 0x599 bytes(s),
z:\s\git\llvm-project\clang\lib\codegen\backendutil.cpp, line 816
0x032E3D4A (0x13AF0B90 0x125E0D70 0x12556980 0x12572F08),
clang::EmitBackendOutput() + 0x21A bytes(s),
z:\s\git\llvm-project\clang\lib\codegen\backendutil.cpp, line 1185
0x06F09F5F (0x0910E264 0xCCCCCCCC 0xCCCCCCCC 0xCCCCCCCC),
clang::CodeGenAction::ExecuteAction() + 0x28F bytes(s),
z:\s\git\llvm-project\clang\lib\codegen\codegenaction.cpp, line 1023 + 0x64
byte(s)
0x039686F4 (0x0910E434 0x0910E43C 0xCCCCCCCC 0xCCCCCCCC),
clang::FrontendAction::Execute() + 0x84 bytes(s),
z:\s\git\llvm-project\clang\lib\frontend\frontendaction.cpp, line 897 + 0xF
byte(s)
0x038F7A64 (0x13A8AF78 0x0910E968 0x0910E43C 0xCCCCCCCC),
clang::CompilerInstance::ExecuteAction() + 0x3C4 bytes(s),
z:\s\git\llvm-project\clang\lib\frontend\compilerinstance.cpp, line 992
0x03ABE886 (0x12546F48 0x0910F9D4 0x0910E9AC 0xCCCCCCCC),
clang::ExecuteCompilerInvocation() + 0x4D6 bytes(s),
z:\s\git\llvm-project\clang\lib\frontendtool\executecompilerinvocation.cpp,
line 252 + 0x14 byte(s)
0x015B5297 (0x0910F5B0 0x0000002D 0x124AEFF8 0x013A39D3), cc1_main() + 0x3A7
bytes(s), z:\s\git\llvm-project\clang\tools\driver\cc1_main.cpp, line 221 + 0xE
byte(s)
0x015A1CB8 (0x0910F5A8 0x0000002F 0x124AF02B 0x00000000), ExecuteCC1Tool() +
0x78 bytes(s), z:\s\git\llvm-project\clang\tools\driver\driver.cpp, line 309 +
0x2B byte(s)
0x015A2335 (0x0000002F 0x11A54C18 0x11940F48 0x0910FA44), main() + 0x5D5
bytes(s), z:\s\git\llvm-project\clang\tools\driver\driver.cpp, line 388 + 0x35
byte(s)
0x06BB3BAE (0x302997A5 0x0132DCB0 0x0132DCB0 0x00F50000), invoke_main() + 0x1E
bytes(s),
d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl, line
78 + 0x1B byte(s)
0x06BB3A17 (0x0910FA54 0x06BB3C28 0x0910FA64 0x77280419),
__scrt_common_main_seh() + 0x157 bytes(s),
d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl, line
288 + 0x5 byte(s)
0x06BB38AD (0x0910FA64 0x77280419 0x00F50000 0x77280400), __scrt_common_main()
+ 0xD bytes(s),
d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl, line
331
0x06BB3C28 (0x00F50000 0x77280400 0x0910FAC0 0x7780662D), mainCRTStartup() +
0x8 bytes(s),
d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp, line 17
0x77280419 (0x00F50000 0xDEF880E7 0x00000000 0x00000000), BaseThreadInitThunk()
+ 0x19 bytes(s)
0x7780662D (0xFFFFFFFF 0x7782519A 0x00000000 0x00000000),
RtlGetAppContainerNamedObjectPath() + 0xED bytes(s)
0x778065FD (0x0132DCB0 0x00F50000 0x00000000 0x00000000),
RtlGetAppContainerNamedObjectPath() + 0xBD bytes(s)

-- 
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/20190510/5a00ff84/attachment-0001.html>


More information about the llvm-bugs mailing list