[llvm-bugs] [Bug 48753] New: Latent assertion failure in AArch64InstrInfo::genAlternativeCodeSequence()

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 14 09:38:46 PST 2021


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

            Bug ID: 48753
           Summary: Latent assertion failure in
                    AArch64InstrInfo::genAlternativeCodeSequence()
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: AArch64
          Assignee: unassignedbugs at nondot.org
          Reporter: rupprecht at google.com
                CC: arnaud.degrandmaison at arm.com,
                    llvm-bugs at lists.llvm.org, smithp352 at googlemail.com,
                    Ties.Stuij at arm.com

https://reviews.llvm.org/D93779 (landed as
49142991a685bd427d7e877c29c77371dfb7634c) changes ADT/SmallVector.h, which
makes clang smart enough to diagnose a -Wsometimes-uninitialized for a `MUL`
value passed to a SmallVector in AArch64InstrInfo.cpp. This build warning (or
error when -Werror is enabled) is fixed by always initializing to nullptr in
752fafda3dbf1f4885c64408a13ddb67c91ccb13, but if we add an assertion that MUL
is not nullptr when we add it to the SmallVector, we get an assertion failure
in two tests:

$ ninja check-llvm-codegen-aarch64
FAIL: LLVM :: CodeGen/AArch64/tailmerging_in_mbp.ll (1886 of 1908)
******************** TEST 'LLVM :: CodeGen/AArch64/tailmerging_in_mbp.ll'
FAILED ********************
Script:
--
: 'RUN: at line 1';   /home/rupprecht/src/llvm-build/dev/bin/llc
</home/rupprecht/src/llvm-project/llvm/test/CodeGen/AArch64/tailmerging_in_mbp.ll
-mtriple=aarch64-eabi -verify-machine-dom-info |
/home/rupprecht/src/llvm-build/dev/bin/FileCheck --allow-unused-prefixes=false
/home/rupprecht/src/llvm-project/llvm/test/CodeGen/AArch64/tailmerging_in_mbp.ll
--
Exit Code: 2

Command Output (stderr):
--
llc:
/home/rupprecht/src/llvm-project/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp:5697:
virtual void
llvm::AArch64InstrInfo::genAlternativeCodeSequence(llvm::MachineInstr &,
llvm::MachineCombinerPattern, SmallVectorImpl<llvm::MachineInstr *> &,
SmallVectorImpl<llvm::MachineInstr *> &, DenseMap<unsigned int, unsigned int>
&) const: Assertion `MUL && "MUL was never set"' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace.
Stack dump:
0.      Program arguments: /home/rupprecht/src/llvm-build/dev/bin/llc
-mtriple=aarch64-eabi -verify-machine-dom-info
1.      Running pass 'Function Pass Manager' on module '<stdin>'.
2.      Running pass 'Machine InstCombiner' on function '@test'
...
Failed Tests (2):
  LLVM :: CodeGen/AArch64/tailmerging_in_mbp.ll
  LLVM :: CodeGen/AArch64/urem-seteq-nonzero.ll

The assertion is already added to llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
at the end of AArch64InstrInfo::genAlternativeCodeSequence(), but commented
out. Uncomment to reproduce the above.

-- 
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/20210114/fc4d65ed/attachment.html>


More information about the llvm-bugs mailing list