LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 32578 - armv7: Assertion failed: (!NodePtr->isKnownSentinel()), function operator*, file include/llvm/ADT/ilist_iterator.h, line 139.
Summary: armv7: Assertion failed: (!NodePtr->isKnownSentinel()), function operator*, f...
Status: RESOLVED FIXED
Alias: None
Product: new-bugs
Classification: Unclassified
Component: new bugs (show other bugs)
Version: trunk
Hardware: Other All
: P normal
Assignee: Matthias Braun
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-08 05:43 PDT by Dimitry Andric
Modified: 2017-11-28 03:36 PST (History)
8 users (show)

See Also:
Fixed By Commit(s):


Attachments
Test case reduced from libreoffice's shapeattributelayer.cxx (1.46 KB, text/x-csrc)
2017-04-08 05:43 PDT, Dimitry Andric
Details
Reduced IR test case, simply run llc (2.22 KB, text/plain)
2017-04-25 18:42 PDT, Vedant Kumar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric 2017-04-08 05:43:21 PDT
Created attachment 18251 [details]
Test case reduced from libreoffice's shapeattributelayer.cxx

Here is an assertion encountered by Michal Meloun, while compiling LibreOffice's slideshow/source/engine/shapeattributelayer.cxx file for armv7-freebsd:

Assertion failed: (!NodePtr->isKnownSentinel()), function operator*, file include/llvm/ADT/ilist_iterator.h, line 139.

Attached is a reduced test case, to be compiled with:

clang -cc1 -triple armv7 -S -O2 lo.cpp

Specifically, the 'armv7' is important, just 'arm' or 'armv6' will not trigger the assertion.
Comment 1 Vedant Kumar 2017-04-25 18:42:37 PDT
Created attachment 18363 [details]
Reduced IR test case, simply run llc

This crashes with trunk.
Comment 2 Vedant Kumar 2017-04-25 18:51:26 PDT
Naive patch:

```
diff --git a/lib/Target/ARM/ARMFrameLowering.cpp b/lib/Target/ARM/ARMFrameLowering.cpp
index 4f7a0ab4e22..7dd5f999843 100644
--- a/lib/Target/ARM/ARMFrameLowering.cpp
+++ b/lib/Target/ARM/ARMFrameLowering.cpp
@@ -479,7 +479,7 @@ void ARMFrameLowering::emitPrologue(MachineFunction &MF,
   if (DPRCSSize > 0) {
     // Since vpush register list cannot have gaps, there may be multiple vpush
     // instructions in the prologue.
-    while (MBBI->getOpcode() == ARM::VSTMDDB_UPD) {
+    while (MBBI != MBB.end() && MBBI->getOpcode() == ARM::VSTMDDB_UPD) {
       DefCFAOffsetCandidates.addInst(MBBI, sizeOfSPAdjustment(*MBBI));
       LastPush = MBBI++;
     }
```
Comment 3 Matthias Braun 2017-11-27 17:18:38 PST
Thanks for the patch Vedant and sorry for the long delay. Committed in r319130
Comment 4 Dimitry Andric 2017-11-28 03:36:14 PST
Might be nice to get this into 5.0.1 too, as it is a small change?