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
Crash in GetNeonType #42120
Comments
Digging a bit further: in my local build (a single-stage build compiled with clang 8.0.0) the |
I'm guess it's because of http://llvm.org/r357067 But the underlying problem of having a case that's not covered by the switch in GetNeonType() is what needs to be fixed. |
Excerpt from EmitAArch64BuiltinExpr: llvm::APSInt Result; This looks at the last argument in This doesn't seem right, it doesn't make sense to treat an integer literal from user-provided source as a |
Elsewhere in the source is another occurrence of that pattern, this time prefaced with the comment: // Get the last argument, which specifies the vector type. That's not true for |
So it looks like, the I wonder if this is just an ordering/logic issue in |
I'm testing out a patch that does a bulk move of the FWIW on [32-bit] ARM, the relative ordering of the code regions seems OK as-is. |
https://reviews.llvm.org/rL367323 (I'll leave the bug open to track the merge) |
Merged to release_90 in r367525. Thanks! |
Extended Description
Clang-cl from the release_90 branch crashes while compiling Firefox for aarch64-windows.
Unfortunately I couldn't reproduce this locally, it only crashes with Mozilla automation's clang builds, which don't publish debug symbols. By tracing execution side-by-side with the crashy build and my own build that has symbols, I narrowed this down to an unhandled switch case in
GetNeonType
. TheTypeFlags.Flags
are -1.Reduced buffer.c:
foo() {
_InterlockedExchangeAdd64(0, -1);
}
Command line from the reproducer script:
"clang-cl.exe" "-cc1" "-triple" "aarch64-unknown-windows-msvc19.16.27026" "-emit-obj" "-mincremental-linker-compatible" "-disable-free" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "buffer.c" "-mrelocation-model" "static" "-mthread-model" "posix" "-mdisable-fp-elim" "-relaxed-aliasing" "-fmath-errno" "-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-target-cpu" "generic" "-target-feature" "+neon" "-target-abi" "aapcs" "-fallow-half-arguments-and-returns" "-D_MT" "-D_DLL" "--dependent-lib=msvcrt" "--dependent-lib=oldnames" "-stack-protector" "2" "-fdiagnostics-format" "msvc" "-gcodeview" "-debug-info-kind=limited" "-ffunction-sections" "-fdata-sections" "-coverage-notes-file" "z:\build\build\src\obj-firefox\media\ffvpx\libavutil\buffer.gcno" "-D" "DEBUG=1" "-D" "_USE_MATH_DEFINES" "-D" "inline=__inline" "-D" "HAVE_AV_CONFIG_H" "-D" "ASSERT_LEVEL=2" "-D" "MOZILLA_CLIENT" "-D" "_HAS_EXCEPTIONS=0" "-O2" "-Wall" "-Wno-unknown-pragmas" "-Wno-ignored-pragmas" "-Wno-deprecated-declarations" "-Wno-invalid-noreturn" "-Wno-parentheses" "-Wno-pointer-sign" "-Wno-sign-compare" "-Wno-switch" "-Wno-type-limits" "-Wno-unused-function" "-Wno-deprecated-declarations" "-Wno-absolute-value" "-Wno-incompatible-pointer-types" "-Wno-string-conversion" "-Wno-visibility" "-Wno-inconsistent-dllimport" "-Wno-macro-redefined" "-ferror-limit" "19" "-fmessage-length" "0" "-fno-use-cxa-atexit" "-fms-extensions" "-fms-compatibility" "-fms-compatibility-version=19.16.27026" "-fdelayed-template-parsing" "-fobjc-runtime=gcc" "-fdiagnostics-show-option" "-vectorize-loops" "-vectorize-slp" "-std=gnu99" "-faddrsig" "-x" "c" "buffer.c"
Stack (the top frame is actually GetNeonType, the symbols are missing):
00 clang_cl!clang::CodeGen::CodeGenFunction::EmitCommonNeonBuiltinExpr
01 clang_cl!clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr
02 clang_cl!clang::CodeGen::CodeGenFunction::EmitBuiltinExpr
03 clang_cl!clang::CodeGen::CodeGenFunction::EmitCallExpr
04 clang_cl!clang::CodeGen::CodeGenFunction::EmitCheckedInBoundsGEP
05 clang_cl!clang::CodeGen::CodeGenFunction::EmitScalarExpr
06 clang_cl!clang::CodeGen::CodeGenFunction::EmitAnyExpr
07 clang_cl!clang::CodeGen::CodeGenFunction::EmitIgnoredExpr
08 clang_cl!clang::CodeGen::CodeGenFunction::EmitStmt
09 clang_cl!clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope
0a clang_cl!clang::CodeGen::CodeGenFunction::EmitFunctionBody
0b clang_cl!clang::CodeGen::CodeGenFunction::GenerateCode
0c clang_cl!clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition
0d clang_cl!clang::CodeGen::CodeGenModule::EmitGlobalDefinition
0e clang_cl!clang::CodeGen::CodeGenModule::EmitGlobal
0f clang_cl!clang::CodeGen::CodeGenModule::EmitTopLevelDecl
10 clang_cl!clang::CreateLLVMCodeGen
11 clang_cl!clang::BackendConsumer::HandleTopLevelDecl
12 clang_cl!clang::ParseAST
13 clang_cl!clang::FrontendAction::Execute
14 clang_cl!clang::CompilerInstance::ExecuteAction
15 clang_cl!clang::ExecuteCompilerInvocation
16 clang_cl!clang::ChainedDiagnosticConsumer::HandleDiagnostic
17 clang_cl
18 clang_cl!llvm::itanium_demangle::OutputStream::writeUnsigned
19 KERNEL32!BaseThreadInitThunk
1a ntdll!RtlUserThreadStart
The text was updated successfully, but these errors were encountered: