New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't use EXPENSIVE_CHECKS in TableGen executable #37000
Comments
Andrew, with what OS and compiler are you seeing this? |
Linux, standart Clang toolchain like here: atischenko@ip-172-31-21-62:~/workspaces$ cat new-workspace-avt77-make.sh mkdir build The last line creates TableGen and trys to use it but can't because of the issue. |
So you're building with gcc? What version? Also, please can you include the error message you see from the Tablegen build. |
Yes, I used gcc to create TableGe. I'll give you all necessary info asap. |
-- The CXX compiler identification is GNU 5.4.0 |
And now I got the following: Scanning dependencies of target LibOptionsTableGen Objects involved in the operation: With gdb I saw usage of sort but I'm not sure it's a sort problem. Most probably there is an attempt to use destructed objects inside sort. Not long ago I had the very similar problem when I tried to sort FunctionDecl* objects to print out the compilation times. |
@mgrang is this something you've seen at all? |
I haven't seen this in my testing. However, I can reproduce the failure using the steps Andrew provided. It seems the crash is coming out of this particular instance of llvm:sort in utils/TableGen/CodeGenTarget.cpp: CodeGenIntrinsicTable::CodeGenIntrinsicTable(const RecordKeeper &RC, llvm::sort(Intrinsics.begin(), Intrinsics.end(), I didn't get a chance to look into this more closely but if I remove the comparator then it seems to go fine. |
What does default comparator do? Simply compares 2 pointers? If yes it means it does not deal with underlying objects and that looks very similar to what I saw with FunctionDecl* pointers (see above). |
*** Bug llvm/llvm-bugzilla-archive#38172 has been marked as a duplicate of this bug. *** |
According to https://stackoverflow.com/questions/22915325/avoiding-self-assignment-in-stdshuffle this is caused by an overly aggressive assertion in libstdc++. I just tried copying the libc++ of std::shuffle() as llvm::shuffle() and using that instead and it appears to fix the problem. If this is considered a reasonable solution I can upload a patch to phabricator. |
Yes thank you, I think that its worth raising as a patch to be discussed by a broader audience. |
This issue still exists. |
Possible fix https://reviews.llvm.org/D98167 |
Should be fixed by 35bf23e |
mentioned in issue llvm/llvm-bugzilla-archive#38172 |
Extended Description
When I build TableGen with EXPENSIVE_CHECKS defined the executable crashes inside llvm::sort during its invocation from CodeGenIntrinsicTable::CodeGenIntrinsicTable
The text was updated successfully, but these errors were encountered: