[llvm-bugs] Issue 34949 in oss-fuzz: llvm:clang-fuzzer: Stack-overflow in clang::DeclSpec::Finish

2021-06-05 Thread ClusterFuzz-External via monorail via llvm-bugs
Status: New
Owner: 
CC: k...@google.com, masc...@google.com, jdevl...@apple.com, igm...@gmail.com, 
d...@google.com, mit...@google.com, bigch...@gmail.com, eney...@google.com, 
llvm-...@lists.llvm.org, j...@chromium.org, v...@apple.com, 
mitch...@outlook.com, xpl...@gmail.com, akils...@apple.com 
Labels: ClusterFuzz Stability-Memory-AddressSanitizer Reproducible 
Engine-libfuzzer OS-Linux Proj-llvm Reported-2021-06-05
Type: Bug

New issue 34949 by ClusterFuzz-External: llvm:clang-fuzzer: Stack-overflow in 
clang::DeclSpec::Finish
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=34949

Detailed Report: https://oss-fuzz.com/testcase?key=4690038356049920

Project: llvm
Fuzzing Engine: libFuzzer
Fuzz Target: clang-fuzzer
Job Type: libfuzzer_asan_llvm
Platform Id: linux

Crash Type: Stack-overflow
Crash Address: 0x7ffd9f8b4e60
Crash State:
  clang::DeclSpec::Finish
  clang::Parser::ParseTypeQualifierListOpt
  clang::Parser::ParseDeclaratorInternal
  
Sanitizer: address (ASAN)

Regressed: 
https://oss-fuzz.com/revisions?job=libfuzzer_asan_llvm&range=202105300631:202105310618

Reproducer Testcase: https://oss-fuzz.com/download?testcase_id=4690038356049920

Issue filed automatically.

See https://google.github.io/oss-fuzz/advanced-topics/reproducing for 
instructions to reproduce this bug locally.
When you fix this bug, please
  * mention the fix revision(s).
  * state whether the bug was a short-lived regression or an old bug in any 
stable releases.
  * add any other useful information.
This information can help downstream consumers.

If you need to contact the OSS-Fuzz team with a question, concern, or any other 
feedback, please file an issue at https://github.com/google/oss-fuzz/issues. 
Comments on individual Monorail issues are not monitored.

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 50586] New: Poor OpenSSL performance (Clang 12 vs GCC 11)

2021-06-05 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=50586

Bug ID: 50586
   Summary: Poor OpenSSL performance (Clang 12 vs GCC 11)
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Scalar Optimizations
  Assignee: unassignedb...@nondot.org
  Reporter: david.bolvan...@gmail.com
CC: llvm-bugs@lists.llvm.org

Results
https://i.imgur.com/nSn6jHU.png


RSA 4096-bit performance of OpenSSL (Clang) is 54% worse than OpenSSL (GCC) on
Xeon Ice Lake.

Source:
https://www.phoronix.com/scan.php?page=article&item=clang12-gcc11-icelake&num=6

Benchmark is available here: https://openbenchmarking.org/test/pts/openssl

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 50587] New: wrong code at -O3 on x86_64-linux-gnu

2021-06-05 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=50587

Bug ID: 50587
   Summary: wrong code at -O3 on x86_64-linux-gnu
   Product: libraries
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Loop Optimizer
  Assignee: unassignedb...@nondot.org
  Reporter: zhendong...@inf.ethz.ch
CC: llvm-bugs@lists.llvm.org

[611] % clangtk -v
clang version 13.0.0 (https://github.com/llvm/llvm-project.git
92ce29ee45b26513a9f4e42c6f287f43cb3de238)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /local/suz-local/opfuzz/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
[612] % 
[612] % clangtk -O2 small.c; ./a.out
[613] % 
[613] % clangtk -O3 small.c
[614] % ./a.out
Aborted
[615] % 
[615] % cat small.c
int a, b, c;
void f() {
  int d = 1, e = 1;
  while (1)
for (; c < 1; c++) {
  if (!d && e)
continue;
  if (a < 1) {
if (e)
  b++;
return;
  }
  d = 0;
  while (b)
e++;
}
}
int main() {
  f();
  if (b != 1)
__builtin_abort ();
  return 0;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 50527] llvm/ADT/DenseMapInfo.h isn't layered right

2021-06-05 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=50527

Nikita Popov  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 CC||nikita@gmail.com
 Status|NEW |RESOLVED

--- Comment #1 from Nikita Popov  ---
This has been addressed by https://reviews.llvm.org/D103422 and
https://reviews.llvm.org/D103491.

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 39477] Failure to simplify floor(float(int x)) -> float(int x)

2021-06-05 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=39477

Simon Pilgrim  changed:

   What|Removed |Added

  Component|Common Code Generator Code  |Scalar Optimizations
 Fixed By Commit(s)||03e74928762edd4ac74af7f9b7a
   ||cb6c672f13d1e
 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #2 from Simon Pilgrim  ---
https://godbolt.org/z/5zT99nTTq

This was fixed between 8.x and 9.x by rG03e74928762e

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 50588] New: Assertion failure in SmartPtrChecker when initializing std::unique_ptr with nullptr

2021-06-05 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=50588

Bug ID: 50588
   Summary: Assertion failure in SmartPtrChecker when initializing
std::unique_ptr with nullptr
   Product: clang
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: Static Analyzer
  Assignee: dcough...@apple.com
  Reporter: deep.majumder2...@gmail.com
CC: dcough...@apple.com, llvm-bugs@lists.llvm.org

For the following code:
```
#include 

void foo(s) {
auto hell = std::unique_ptr(nullptr);
*hell;
}
```
the assertion at `SmartPtrModeling.cpp:240`:
`TrackingExpr->getType()->isPointerType() && "Adding a non pointer value to
TrackedRegionMap"` fails.

The full stack trace:
```
clang++:
/home/dknite/work/llvm-project/llvm/clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:242:
bool (anonymous namespace)::SmartPtrModeling::evalCall(const
clang::ento::CallEvent &, clang::ento::CheckerContext &) const: Assertion
`TrackingExpr->getType()->isPointerType() && "Adding a non pointer value to
TrackedRegionMap"' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.  Program arguments: ./llvm/release/bin/clang++ -std=c++20 -Xclang
-analyze -Xclang
-analyzer-checker=core,cplusplus.Move,cplusplus.NewDelete,alpha.cplusplus.SmartPtr
-Xclang -analyzer-output=text -Xclang -analyzer-config -Xclang
cplusplus.SmartPtrModeling:ModelSmartPtrDereference=true -c make_unique.cpp
1.   parser at end of file
2.  While analyzing stack: 
#0 Calling foo
3.  make_unique.cpp:8:17: Error evaluating statement
4.  make_unique.cpp:8:17: Error evaluating statement
 #0 0x7f9a6c3317b1 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
/home/dknite/work/llvm-project/llvm/llvm/lib/Support/Unix/Signals.inc:565:13
 #1 0x7f9a6c32f7e0 llvm::sys::RunSignalHandlers()
/home/dknite/work/llvm-project/llvm/llvm/lib/Support/Signals.cpp:77:18
 #2 0x7f9a6c330d9b llvm::sys::CleanupOnSignal(unsigned long)
/home/dknite/work/llvm-project/llvm/llvm/lib/Support/Unix/Signals.inc:0:3
 #3 0x7f9a6c257df3 (anonymous
namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long)
/home/dknite/work/llvm-project/llvm/llvm/lib/Support/CrashRecoveryContext.cpp:75:5
 #4 0x7f9a6c257fab CrashRecoverySignalHandler(int)
/home/dknite/work/llvm-project/llvm/llvm/lib/Support/CrashRecoveryContext.cpp:0:51
 #5 0x7f9a6fe35870 __restore_rt sigaction.c:0:0
 #6 0x7f9a6bc2fd22 raise (/usr/lib/libc.so.6+0x3cd22)
 #7 0x7f9a6bc19862 abort (/usr/lib/libc.so.6+0x26862)
 #8 0x7f9a6bc19747 _nl_load_domain.cold loadmsgcat.c:0:0
 #9 0x7f9a6bc28616 (/usr/lib/libc.so.6+0x35616)
#10 0x7f9a68c24b02 getInnerPointerType(clang::ento::CallEvent const&,
clang::ento::CheckerContext&)
/home/dknite/work/llvm-project/llvm/clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:0:0
#11 0x7f9a68c24b02 (anonymous
namespace)::SmartPtrModeling::handleBoolConversion(clang::ento::CallEvent
const&, clang::ento::CheckerContext&) const
/home/dknite/work/llvm-project/llvm/clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:575:29
#12 0x7f9a68c24b02 (anonymous
namespace)::SmartPtrModeling::evalCall(clang::ento::CallEvent const&,
clang::ento::CheckerContext&) const
/home/dknite/work/llvm-project/llvm/clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:193:7
#13 0x7f9a68c24b02 bool clang::ento::eval::Call::_evalCall<(anonymous
namespace)::SmartPtrModeling>(void*, clang::ento::CallEvent const&,
clang::ento::CheckerContext&)
/home/dknite/work/llvm-project/llvm/clang/include/clang/StaticAnalyzer/Core/Checker.h:479:40
#14 0x7f9a687492bd clang::ento::CheckerFn::operator()(clang::ento::CallEvent
const&, clang::ento::CheckerContext&) const
/home/dknite/work/llvm-project/llvm/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h:0:12
#15 0x7f9a687492bd
clang::ento::CheckerManager::runCheckersForEvalCall(clang::ento::ExplodedNodeSet&,
clang::ento::ExplodedNodeSet const&, clang::ento::CallEvent const&,
clang::ento::ExprEngine&, clang::ento::EvalCallOptions const&)
/home/dknite/work/llvm-project/llvm/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp:676:21
#16 0x7f9a6878e4c8
llvm::SmallVectorTemplateCommon::isSmall()
const
/home/dknite/work/llvm-project/llvm/llvm/include/llvm/ADT/SmallVector.h:129:39
#17 0x7f9a6878e4c8
llvm::SmallVectorImpl::~SmallVectorImpl()
/home/dknite/work/llvm-project/llvm/llvm/include/llvm/ADT/SmallVector.h:581:16
#18 0x7f9a6878e4c8 llvm::SmallVector::~SmallVector()
/home/dknite/work/llvm-project/llvm/llvm/include/llvm/ADT/SmallVector.h:1176:3
#19 0x7f9a6878e4c8 llvm::SetVector,
llvm::SmallDenseSet > >::~SetVector()
/home/dknite/work/llvm-project/llvm/llvm/include/llvm/ADT/SetVector.h:40:7
#20 0x7f9a6878e4c8 clang::ento::Explode

[llvm-bugs] [Bug 50589] New: [Inliner] Noalias metadata incorrectly added to simplified calls

2021-06-05 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=50589

Bug ID: 50589
   Summary: [Inliner] Noalias metadata incorrectly added to
simplified calls
   Product: libraries
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: Interprocedural Optimizations
  Assignee: unassignedb...@nondot.org
  Reporter: nikita@gmail.com
CC: jeroen.dobbela...@synopsys.com,
llvm-bugs@lists.llvm.org

>From https://reviews.llvm.org/D102110#inline-972360:

define <2 x i8> @callee(<2 x i8>* %ptr1, <2 x i8>* noalias %ptr2, <2 x i1>
%mask, <2 x i8> %passthru) {
  %ret = call <2 x i8> @llvm.masked.load.v2i8(<2 x i8>* %ptr1, i32 1, <2 x i1>
%mask, <2 x i8> %passthru)
  store <2 x i8> zeroinitializer, <2 x i8>* %ptr2
  ret <2 x i8> %ret
}

define void @caller(<2 x i8>* %ptr1, <2 x i8>* %ptr2) {
  %passthru = load <2 x i8>, <2 x i8>* %ptr2
  call <2 x i8> @callee(<2 x i8>* %ptr1, <2 x i8>* %ptr2, <2 x i1>
zeroinitializer, <2 x i8> %passthru)
  ret void
}

declare <2 x i8> @llvm.masked.load.v2i8(<2 x i8>*, i32, <2 x i1>, <2 x i8>)

Results in:

define <2 x i8> @callee(<2 x i8>* %ptr1, <2 x i8>* noalias %ptr2, <2 x i1>
%mask, <2 x i8> %passthru) {
  %ret = call <2 x i8> @llvm.masked.load.v2i8.p0v2i8(<2 x i8>* %ptr1, i32 1, <2
x i1> %mask, <2 x i8> %passthru)
  store <2 x i8> zeroinitializer, <2 x i8>* %ptr2, align 2
  ret <2 x i8> %ret
}

define void @caller(<2 x i8>* %ptr1, <2 x i8>* %ptr2) {
  %passthru = load <2 x i8>, <2 x i8>* %ptr2, align 2, !noalias !0
  call void @llvm.experimental.noalias.scope.decl(metadata !0)
  store <2 x i8> zeroinitializer, <2 x i8>* %ptr2, align 2, !alias.scope !0
  ret void
}

In this case, we don't even need the incorrect annotation to go on an
instruction from the caller, it can also happen with a callee instruction:

define <2 x i8> @callee(<2 x i8>* %ptr1, <2 x i8>* noalias %ptr2, <2 x i1>
%mask) {
  %passthru = load <2 x i8>, <2 x i8>* %ptr2
  %ret = call <2 x i8> @llvm.masked.load.v2i8(<2 x i8>* %ptr1, i32 1, <2 x i1>
%mask, <2 x i8> %passthru)
  store <2 x i8> zeroinitializer, <2 x i8>* %ptr2
  ret <2 x i8> %ret
}

define void @caller(<2 x i8>* %ptr1, <2 x i8>* %ptr2) {
  call <2 x i8> @callee(<2 x i8>* %ptr1, <2 x i8>* %ptr2, <2 x i1>
zeroinitializer)
  ret void
}

declare <2 x i8> @llvm.masked.load.v2i8(<2 x i8>*, i32, <2 x i1>, <2 x i8>)

Results in:

define <2 x i8> @callee(<2 x i8>* %ptr1, <2 x i8>* noalias %ptr2, <2 x i1>
%mask) {
  %passthru = load <2 x i8>, <2 x i8>* %ptr2, align 2
  %ret = call <2 x i8> @llvm.masked.load.v2i8.p0v2i8(<2 x i8>* %ptr1, i32 1, <2
x i1> %mask, <2 x i8> %passthru)
  store <2 x i8> zeroinitializer, <2 x i8>* %ptr2, align 2
  ret <2 x i8> %ret
}

define void @caller(<2 x i8>* %ptr1, <2 x i8>* %ptr2) {
  call void @llvm.experimental.noalias.scope.decl(metadata !0)
  %passthru.i = load <2 x i8>, <2 x i8>* %ptr2, align 2, !alias.scope !0,
!noalias !0
  store <2 x i8> zeroinitializer, <2 x i8>* %ptr2, align 2, !alias.scope !0
  ret void
}

Note how the metadata is claiming that the load does not alias ... with itself.

We should not be adding noalias metadata to instructions that are the result of
simplification, as they may not correspond to the instruction from the original
function.

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 50590] New: Assertion `!A->getDeducedType().isNull() && "cannot request the size of an undeduced or dependent auto type"' failed

2021-06-05 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=50590

Bug ID: 50590
   Summary: Assertion `!A->getDeducedType().isNull() && "cannot
request the size of an undeduced or dependent auto
type"' failed
   Product: clang
   Version: trunk
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P
 Component: C++11
  Assignee: unassignedclangb...@nondot.org
  Reporter: sguel...@redhat.com
CC: blitzrak...@gmail.com, dgre...@apple.com,
erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
richard-l...@metafoo.co.uk

This may be a duplicate of existing bugs, but the reproducer is super simple,
so I'm keeping track of it here

```
template 
struct pack {
template 
// OK : constexpr static bool some_boolean_cx_value = true;  
constexpr static auto some_boolean_cx_value = true;  
};

void usage() {
pack::some_boolean_cx_value;
}
```

Interestingly, the bug got introduced between clang 8 and clang 9

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] Issue 34974 in oss-fuzz: llvm:clang-fuzzer: Stack-overflow in clang::Sema::EmitCurrentDiagnostic

2021-06-05 Thread ClusterFuzz-External via monorail via llvm-bugs
Status: New
Owner: 
CC: k...@google.com, masc...@google.com, jdevl...@apple.com, igm...@gmail.com, 
d...@google.com, mit...@google.com, bigch...@gmail.com, eney...@google.com, 
llvm-...@lists.llvm.org, j...@chromium.org, v...@apple.com, 
mitch...@outlook.com, xpl...@gmail.com, akils...@apple.com 
Labels: ClusterFuzz Stability-Memory-AddressSanitizer Reproducible 
Engine-libfuzzer OS-Linux Proj-llvm Reported-2021-06-06
Type: Bug

New issue 34974 by ClusterFuzz-External: llvm:clang-fuzzer: Stack-overflow in 
clang::Sema::EmitCurrentDiagnostic
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=34974

Detailed Report: https://oss-fuzz.com/testcase?key=6700145596039168

Project: llvm
Fuzzing Engine: libFuzzer
Fuzz Target: clang-fuzzer
Job Type: libfuzzer_asan_llvm
Platform Id: linux

Crash Type: Stack-overflow
Crash Address: 0x7fffeed5dfc0
Crash State:
  clang::Sema::EmitCurrentDiagnostic
  clang::Sema::ImmediateDiagBuilder::~ImmediateDiagBuilder
  clang::Sema::SemaDiagnosticBuilder::~SemaDiagnosticBuilder
  
Sanitizer: address (ASAN)

Regressed: 
https://oss-fuzz.com/revisions?job=libfuzzer_asan_llvm&range=202106040607:202106050632

Reproducer Testcase: https://oss-fuzz.com/download?testcase_id=6700145596039168

Issue filed automatically.

See https://google.github.io/oss-fuzz/advanced-topics/reproducing for 
instructions to reproduce this bug locally.
When you fix this bug, please
  * mention the fix revision(s).
  * state whether the bug was a short-lived regression or an old bug in any 
stable releases.
  * add any other useful information.
This information can help downstream consumers.

If you need to contact the OSS-Fuzz team with a question, concern, or any other 
feedback, please file an issue at https://github.com/google/oss-fuzz/issues. 
Comments on individual Monorail issues are not monitored.

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 50591] New: wrong comparison category/crash involving user-defined conversions to builtin types

2021-06-05 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=50591

Bug ID: 50591
   Summary: wrong comparison category/crash involving user-defined
conversions to builtin types
   Product: clang
   Version: trunk
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P
 Component: C++2a
  Assignee: unassignedclangb...@nondot.org
  Reporter: mizve...@gmail.com
CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk

Wrong comparison category is produced for classes with defaulted spaceship
operator which contain members with user-defined conversion operator to
integral type.
For builds with assertions enabled, this produces a crash instead for
conversions to any builtin type.

Reproduction:
```
#include 

struct a1 {
  operator int() const;
};
struct b1 {
  auto operator<=>(b1 const &) const = default;
  a1 f;
};
std::strong_ordering cmp_b1 = b1() <=> b1();
```

This will either result in:
* Incorrect diagnostic: error: no viable conversion from
'std::partial_ordering' to 'std::strong_ordering'
* Crash when assertions are enabled: Assertion failed: Cat && "no category for
builtin comparison?", file SemaDeclCXX.cpp

Workspace for convenience: https://godbolt.org/z/EasTWssje

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs


[llvm-bugs] [Bug 50592] New: Assertion `(ID || !Mod) && "asked for module ID for non-local, non-imported module"' failed

2021-06-05 Thread via llvm-bugs
https://bugs.llvm.org/show_bug.cgi?id=50592

Bug ID: 50592
   Summary: Assertion `(ID || !Mod) && "asked for module ID for
non-local, non-imported module"' failed
   Product: clang
   Version: trunk
  Hardware: PC
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P
 Component: C++2a
  Assignee: unassignedclangb...@nondot.org
  Reporter: davidfromonl...@gmail.com
CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk

Compiling the following translation unit

```
#include 
```

with `clang++ -std=c++20 -stdlib=libc++ -fmodules`

causes clang to crash with

```
clang++: /root/llvm-project/clang/lib/Serialization/ASTWriter.cpp:2502:
unsigned int clang::ASTWriter::getSubmoduleID(clang::Module*): Assertion `(ID
|| !Mod) && "asked for module ID for non-local, non-imported module"' failed.
clang++: /root/llvm-project/llvm/include/llvm/Bitstream/BitstreamWriter.h:124:
llvm::BitstreamWriter::~BitstreamWriter(): Assertion `BlockScope.empty() &&
CurAbbrevs.empty() && "Block imbalance"' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.  Program arguments:
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -g -o /app/output.s
-mllvm --x86-asm-syntax=intel -S
--gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics
-fno-crash-diagnostics -std=c++20 -stdlib=libc++ -fmodules 
1.  :1:2: current parser token 'include'
 #0 0x55d922ec2a6f PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x55d922ec0890 llvm::sys::CleanupOnSignal(unsigned long)
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x378b890)
 #2 0x55d922e107a8 CrashRecoverySignalHandler(int)
CrashRecoveryContext.cpp:0:0
 #3 0x7f2869ffe3c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #4 0x7f2869ace18b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4618b)
 #5 0x7f2869aad859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x25859)
 #6 0x7f2869aad729 (/lib/x86_64-linux-gnu/libc.so.6+0x25729)
 #7 0x7f2869abef36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
 #8 0x55d9239babe0 clang::PCHGenerator::~PCHGenerator()
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4285be0)
 #9 0x55d9239bac09 clang::PCHGenerator::~PCHGenerator()
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4285c09)
#10 0x55d9237fc7f2 clang::MultiplexConsumer::~MultiplexConsumer()
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x40c77f2)
#11 0x55d92376a9ea clang::CompilerInstance::~CompilerInstance()
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x40359ea)
#12 0x55d92376fb02 compileModuleImpl(clang::CompilerInstance&,
clang::SourceLocation, llvm::StringRef, clang::FrontendInputFile,
llvm::StringRef, llvm::StringRef, llvm::function_ref, llvm::function_ref) CompilerInstance.cpp:0:0
#13 0x55d923772fac
clang::CompilerInstance::findOrCompileModuleAndReadAST(llvm::StringRef,
clang::SourceLocation, clang::SourceLocation, bool)
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x403dfac)
#14 0x55d923773c1e
clang::CompilerInstance::loadModule(clang::SourceLocation,
llvm::ArrayRef >,
clang::Module::NameVisibilityKind, bool)
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x403ec1e)
#15 0x55d925e680aa
clang::Preprocessor::HandleHeaderIncludeOrImport(clang::SourceLocation,
clang::Token&, clang::Token&, clang::SourceLocation, clang::DirectoryLookup
const*, clang::FileEntry const*)
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x67330aa)
#16 0x55d925e69216
clang::Preprocessor::HandleIncludeDirective(clang::SourceLocation,
clang::Token&, clang::DirectoryLookup const*, clang::FileEntry const*)
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6734216)
#17 0x55d925e6c98b clang::Preprocessor::HandleDirective(clang::Token&)
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x673798b)
#18 0x55d925e33801 clang::Lexer::LexTokenInternal(clang::Token&, bool)
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66fe801)
#19 0x55d925e35856 clang::Lexer::Lex(clang::Token&)
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6700856)
#20 0x55d925e9feb7 clang::Preprocessor::Lex(clang::Token&)
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x676aeb7)
#21 0x55d924d2f7c2 clang::Parser::ConsumeToken()
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x55fa7c2)
#22 0x55d924d2e35f clang::ParseAST(clang::Sema&, bool, bool)
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x55f935f)
#23 0x55d923e6bc88 clang::CodeGenAction::ExecuteAction()
(/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4736c88)
#24 0x55d9237cd10