-
Notifications
You must be signed in to change notification settings - Fork 264
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
[BUG] Fatal error in clang when building with -O2 on arm64 #1207
Comments
If it's quick to find the fix to cherry-pick, I think we can do this in r21b, otherwise this'll get moved to r21c. |
Reproduces with ToT as well. Get the same error as the original report. Debug build gives the following assertion:
|
Thanks to @gburgessiv for reducing the repro to the following. Need to test this with r20 to see if this is a regression.
|
Looks like LLVM 38a0616c1df029aff481eb0224dacb55c317865e (aka r357161) is where this crash started occurring. Given that ToT is ~30K commits beyond that ATM, new sources might've been introduced in the meantime. |
Per https://github.com/android/ndk/wiki/NDK-Release-Process, this is a Medium severity issue, so we should fix this for the next LTS toolchain update. |
Yep, it's already been moved to r21c. |
We need to get this into the LTS branch and then ship that in order to fully close this. |
I'll cherry-pick it to llvm-r365631. |
🤦♂ Thanks for noticing the auto-close. |
… illegal type Summary: It can be the case that a vector type is legal but the corresponding scalar type is not legal for an architecture (i8 vs. v16i8 on AArch64). Check if the scalar type created when folding truncate(build_vector(x,y)) -> build_vector(truncate(x),truncate(y)) is legal if we are running after the type legalizer. This fixes android/ndk#1207. Reviewers: RKSimon, srhines Subscribers: kristof.beyls, hiraditya, danielkiss, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D76312
Context: https://github.com/android/ndk/wiki/Changelog-r21#r21c Changes: * [Issue 1060][0]: A macOS app bundle that is signed and notarized is now available for download from our wiki and our website. Note that because only bundles may use RPATHs and pass notarization, the traditional NDK package for macOS *cannot be notarized. The SDK will continue to use the traditional package as the app bundle requires layout changes that would make it incompatible with Android Studio. The NDK is not quarantined when it is downloaded via the SDK manager, so is curently allowed by Gatekeeper. The SDK manager is currently the most reliable way to get the NDK for macOS. * [Issue 1207][1]: Fix fatal error in clang when building with -O2 on arm64. * [Issue 1239][2]: Fix network drive issues for clang. * [Issue 1229][3]: README.md turned back to ordinary file. [0]: android/ndk#1060 [1]: android/ndk#1207 [2]: android/ndk#1239 [3]: android/ndk#1229
Context: https://github.com/android/ndk/wiki/Changelog-r21#r21c Changes: * [Issue 1060][0]: A macOS app bundle that is signed and notarized is now available for download from our wiki and our website. Note that because only bundles may use RPATHs and pass notarization, the traditional NDK package for macOS *cannot* be notarized. The SDK will continue to use the traditional package as the app bundle requires layout changes that would make it incompatible with Android Studio. The NDK is not quarantined when it is downloaded via the SDK manager, so is currently allowed by Gatekeeper. The SDK manager is currently the most reliable way to get the NDK for macOS. * [Issue 1207][1]: Fix fatal error in clang when building with -O2 on arm64. * [Issue 1239][2]: Fix network drive issues for clang. * [Issue 1229][3]: README.md turned back to ordinary file. [0]: android/ndk#1060 [1]: android/ndk#1207 [2]: android/ndk#1239 [3]: android/ndk#1229
Context: https://github.com/android/ndk/wiki/Changelog-r21#r21c Changes: * [Issue 1060][0]: A macOS app bundle that is signed and notarized is now available for download from our wiki and our website. Note that because only bundles may use RPATHs and pass notarization, the traditional NDK package for macOS *cannot* be notarized. The SDK will continue to use the traditional package as the app bundle requires layout changes that would make it incompatible with Android Studio. The NDK is not quarantined when it is downloaded via the SDK manager, so is currently allowed by Gatekeeper. The SDK manager is currently the most reliable way to get the NDK for macOS. * [Issue 1207][1]: Fix fatal error in clang when building with -O2 on arm64. * [Issue 1239][2]: Fix network drive issues for clang. * [Issue 1229][3]: README.md turned back to ordinary file. [0]: android/ndk#1060 [1]: android/ndk#1207 [2]: android/ndk#1239 [3]: android/ndk#1229
Bug: android/ndk#1207. This issue is present since r357161 (38a0616c1). Change-Id: I5f200ba01764828a31eb3e51f00bca29fda865e5
… illegal type Summary: It can be the case that a vector type is legal but the corresponding scalar type is not legal for an architecture (i8 vs. v16i8 on AArch64). Check if the scalar type created when folding truncate(build_vector(x,y)) -> build_vector(truncate(x),truncate(y)) is legal if we are running after the type legalizer. This fixes android/ndk#1207. Reviewers: RKSimon, srhines Subscribers: kristof.beyls, hiraditya, danielkiss, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D76312
Description
I've run into the error below when compiling a particular file with -O2 on the arm64 ABI. It doesn't happen with -O1 or -O3 on arm64, and no problems with -O2 on the same file with other ABIs. Preprocessed source and run script are also attached: bug.zip
fatal error: error in backend: Cannot select: 0x62a2a28: v4i16 = AArch64ISD::DUP 0x62ab698, ./src/vice/vicii/vicii-draw.c:1490:24 @[ ./src/vice/vicii/vicii-draw.c:1509:5 ]
0x62ab698: i16 = truncate 0x62ab700, ./src/vice/vicii/vicii-draw.c:1490:24 @[ ./src/vice/vicii/vicii-draw.c:1509:5 ]
0x62ab700: i32,ch = CopyFromReg 0x61be328, Register:i32 %7, ./src/vice/vicii/vicii-draw.c:1489:13 @[ ./src/vice/vicii/vicii-draw.c:1509:5 ]
0x62aaf48: i32 = Register %7
In function: vicii_draw_init
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Android (5900059 based on r365631c) clang version 9.0.8 (https://android.googlesource.com/toolchain/llvm-project 207d7abc1a2abf3ef8d4301736d6a7ebc224a290) (based on LLVM 9.0.8svn)
Target: aarch64-none-linux-android21
Thread model: posix
InstalledDir: /opt/android-sdk-update-manager/ndk/21.1.6210238/toolchains/llvm/prebuilt/linux-x86_64/bin
clang: note: diagnostic msg: PLEASE submit a bug report to https://github.com/android-ndk/ndk/issues and include the crash backtrace, preprocessed source, and associated run script.
Environment Details
The text was updated successfully, but these errors were encountered: