Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Assertion `!FoundVal && "Key already in new map?"' failed after D6594 #50201

Closed Quuxplusone closed 3 years ago

Quuxplusone commented 3 years ago
Bugzilla Link PR51232
Status RESOLVED FIXED
Importance P enhancement
Reported by Martin Storsjö (martin@martin.st)
Reported on 2021-07-27 15:43:29 -0700
Last modified on 2021-10-11 20:29:08 -0700
Version trunk
Hardware PC All
CC llvm-bugs@lists.llvm.org, rnk@google.com, timshen91@gmail.com, tstellar@redhat.com, w3cing@gmail.com
Fixed by commit(s) rG2a2847823f0d13188c43ebdd0baf42a95df750c7, rG6eb2ffbaeb56c8b08ad17c823e1699b964e10b8b, rG1f35d7c48278, rG0661286a55fb
Attachments wine-preproc.c (1899 bytes, text/plain)
wine-preproc.c.zip (535390 bytes, application/zip)
Blocks PR52147
Blocked by
See also
Created attachment 25076
Reproduction code

After https://reviews.llvm.org/D6594, applied in https://github.com/llvm/llvm-
project/commit/a0757d8ebdefa1c54896d70d2a04f68fc23f7916, compiling some source
files for aarch64-windows-msvc fails with a failed assert "!FoundVal && "Key
already in new map?"

This can be reproduced with the attached source file like this:

$ clang -target aarch64-windows-msvc -w -c -O2 wine-preproc.c

clang: ../include/llvm/ADT/DenseMap.h:408: void llvm::DenseMapBase<DerivedT,
KeyT, ValueT, KeyInfoT, BucketT>::moveFromOldBuckets(BucketT*, BucketT*) [with
DerivedT = llvm::DenseMap<llvm::ConstantExpr*, llvm::detail::DenseSetEmpty,
llvm::ConstantUniqueMap<llvm::ConstantExpr>::MapInfo,
llvm::detail::DenseSetPair<llvm::ConstantExpr*> >; KeyT = llvm::ConstantExpr*;
ValueT = llvm::detail::DenseSetEmpty; KeyInfoT =
llvm::ConstantUniqueMap<llvm::ConstantExpr>::MapInfo; BucketT =
llvm::detail::DenseSetPair<llvm::ConstantExpr*>]: Assertion `!FoundVal && "Key
already in new map?"' failed.
Quuxplusone commented 3 years ago

Attached wine-preproc.c (1899 bytes, text/plain): Reproduction code

Quuxplusone commented 3 years ago

Attached wine-preproc.c.zip (535390 bytes, application/zip): Zipped, non-reduced original source (with more potential to trigger the issue)

Quuxplusone commented 3 years ago

Fixed in main by https://reviews.llvm.org/D107116, 2a2847823f0d13188c43ebdd0baf42a95df750c7 and 6eb2ffbaeb56c8b08ad17c823e1699b964e10b8b.

I'd like to backport those two commits to the 13.x branch to fix the regression.

Quuxplusone commented 3 years ago

Merged: 0661286a55fb