<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Crash with parallel for loop"
href="https://bugs.llvm.org/show_bug.cgi?id=42632">42632</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Crash with parallel for loop
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Keywords</th>
<td>compile-fail, regression
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Static Analyzer
</td>
</tr>
<tr>
<th>Assignee</th>
<td>dcoughlin@apple.com
</td>
</tr>
<tr>
<th>Reporter</th>
<td>v.reichelt@netcologne.de
</td>
</tr>
<tr>
<th>CC</th>
<td>dcoughlin@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>The following valid code snippet triggers an assertion in the static analyzer
when compiled with "clang++ --analyze -fopenmp":
==============================================
void foo()
{
#pragma omp parallel for
for (int i = 0; i < 8; ++i)
for (int j = 0, k = 0; j < 8; ++j)
;
}
==============================================
This is a recent regression, introduced between r365294 and r366050.
Here's the relevant part of the stack trace:
clang-9: /tmp/LLVM/llvm/tools/clang/lib/AST/ParentMap.cpp:117: void
clang::ParentMap::setParent(const clang::Stmt*, const clang::Stmt*): Assertion
`Parent' failed.
#5 0x00007fa049b96ce8 abort (/lib64/libc.so.6+0x36ce8)
#6 0x00007fa049b8e566 __assert_fail_base (/lib64/libc.so.6+0x2e566)
#7 0x00007fa049b8e612 (/lib64/libc.so.6+0x2e612)
#8 0x00000000047b4d8f clang::ParentMap::setParent(clang::Stmt const*,
clang::Stmt const*) (/LLVM/bin/clang-9+0x47b4d8f)
#9 0x000000000444e6bb addParentsForSyntheticStmts(clang::CFG const*,
clang::ParentMap&) (.part.187) (/LLVM/bin/clang-9+0x444e6bb)
#10 0x0000000004450288 clang::AnalysisDeclContext::getParentMap()
(/LLVM/bin/clang-9+0x4450288)
#11 0x00000000038e297b (anonymous
namespace)::DeadStoresChecker::checkASTCodeBody(clang::Decl const*,
clang::ento::AnalysisManager&, clang::ento::BugReporter&) const
(/LLVM/bin/clang-9+0x38e297b)
#12 0x0000000003ba4f7f
clang::ento::CheckerManager::runCheckersOnASTBody(clang::Decl const*,
clang::ento::AnalysisManager&, clang::ento::BugReporter&)
(/LLVM/bin/clang-9+0x3ba4f7f)
#13 0x0000000003847f0e (anonymous
namespace)::AnalysisConsumer::HandleCode(clang::Decl*, unsigned int,
clang::ento::ExprEngine::InliningModes, llvm::DenseSet<clang::Decl const*,
llvm::DenseMapInfo<clang::Decl const*> >*) (/LLVM/bin/clang-9+0x3847f0e)
#14 0x000000000385ec1f clang::RecursiveASTVisitor<(anonymous
namespace)::AnalysisConsumer>::TraverseFunctionDecl(clang::FunctionDecl*)
(/LLVM/bin/clang-9+0x385ec1f)
#15 0x0000000003848961 clang::RecursiveASTVisitor<(anonymous
namespace)::AnalysisConsumer>::TraverseDecl(clang::Decl*)
(.part.5440.constprop.5518) (/LLVM/bin/clang-9+0x3848961)
#16 0x0000000003860200 (anonymous
namespace)::AnalysisConsumer::runAnalysisOnTranslationUnit(clang::ASTContext&)
(/LLVM/bin/clang-9+0x3860200)
#17 0x0000000003861dcb (anonymous
namespace)::AnalysisConsumer::HandleTranslationUnit(clang::ASTContext&)
(/LLVM/bin/clang-9+0x3861dcb)
#18 0x0000000003ce80b9 clang::ParseAST(clang::Sema&, bool, bool)
(/LLVM/bin/clang-9+0x3ce80b9)
#19 0x0000000002cf7089 clang::FrontendAction::Execute()
(/LLVM/bin/clang-9+0x2cf7089)
clang version 9.0.0 (trunk)
Target: x86_64-unknown-linux-gnu
Thread model: posix</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>