Skip to content

The main-snapshot-2025-05-14 compiler can't compile InlineArray #81534

Open
@kkebo

Description

@kkebo

Description

swift-DEVELOPMENT-SNAPSHOT-2025-05-12-a can compile this code, but swift-DEVELOPMENT-SNAPSHOT-2025-05-14-a can't.

Changes between those two tags: swift-DEVELOPMENT-SNAPSHOT-2025-05-12-a...swift-DEVELOPMENT-SNAPSHOT-2025-05-14-a

Reproduction

test.swift:

let a: InlineArray<_, UInt8> = [0]

How to reproduce:

swiftc -parse-as-library -swift-version 6 test.swift

Stack dump

Swift version 6.2-dev (LLVM be9c1978c3677f1, Swift 749e9ee090b6443)
Target: aarch64-unknown-linux-gnu
/home/kebo/.local/share/swiftly/toolchains/main-snapshot-2025-05-14/usr/bin/swift-frontend -frontend -c -primary-file test.swift -target aarch64-unknown-linux-gnu -Xllvm -aarch64-use-tbi -disable-objc-interop -no-color-diagnostics -Xcc -fno-color-diagnostics -swift-version 6 -empty-abi-descriptor -no-auto-bridging-header-chaining -module-name test -in-process-plugin-server-path /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2025-05-14/usr/lib/swift/host/libSwiftInProcPluginServer.so -plugin-path /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2025-05-14/usr/lib/swift/host/plugins -plugin-path /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2025-05-14/usr/local/lib/swift/host/plugins -parse-as-library -o /tmp/TemporaryDirectory.MxZHIP/test-1.o
error: compile command failed due to signal 6 (use -v to see invocation)
swift-frontend: /home/build-user/swift/lib/SILOptimizer/Analysis/RegionAnalysis.cpp:3414: TranslationSemantics swift::regionanalysisimpl::PartitionOpTranslator::visitVectorBaseAddrInst(VectorBaseAddrInst *): Assertion `(TranslationSemantics::LookThrough != TranslationSemantics::LookThrough || isStaticallyLookThroughInst(inst)) && "Out of sync?!"' failed.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0.	Program arguments: /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2025-05-14/usr/bin/swift-frontend -frontend -c -primary-file test.swift -target aarch64-unknown-linux-gnu -Xllvm -aarch64-use-tbi -disable-objc-interop -no-color-diagnostics -Xcc -fno-color-diagnostics -swift-version 6 -empty-abi-descriptor -no-auto-bridging-header-chaining -module-name test -in-process-plugin-server-path /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2025-05-14/usr/lib/swift/host/libSwiftInProcPluginServer.so -plugin-path /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2025-05-14/usr/lib/swift/host/plugins -plugin-path /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2025-05-14/usr/local/lib/swift/host/plugins -parse-as-library -o /tmp/TemporaryDirectory.MxZHIP/test-1.o
1.	Swift version 6.2-dev (LLVM be9c1978c3677f1, Swift 749e9ee090b6443)
2.	Compiling with the current language version
3.	While evaluating request ExecuteSILPipelineRequest(Run pipelines { Mandatory Diagnostic Passes + Enabling Optimization Passes } on SIL for test)
4.	While running pass #24 SILFunctionTransform "SendNonSendable" on SILFunction "@$s4test1a_WZ".
 for declaration 0x555629661660 (at test.swift:1:1)
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  swift-frontend  0x00005555eb993744
1  swift-frontend  0x00005555eb991680
2  swift-frontend  0x00005555eb993e58
3  linux-vdso.so.1 0x00007fff2dac0808 __kernel_rt_sigreturn + 0
4  libc.so.6       0x00007fff2bc80a60
5  libc.so.6       0x00007fff2bc3a72c gsignal + 28
6  libc.so.6       0x00007fff2bc2747c abort + 240
7  libc.so.6       0x00007fff2bc341b8
8  libc.so.6       0x00007fff2bc3421c
9  swift-frontend  0x00005555e5076c6c
10 swift-frontend  0x00005555e50706a0
11 swift-frontend  0x00005555e506f35c
12 swift-frontend  0x00005555e50690b4
13 swift-frontend  0x00005555e508deb8
14 swift-frontend  0x00005555e506ac34
15 swift-frontend  0x00005555e506d1d0
16 swift-frontend  0x00005555e5287e18
17 swift-frontend  0x00005555e52860a0
18 swift-frontend  0x00005555e4d68e48
19 swift-frontend  0x00005555e4d69e7c
20 swift-frontend  0x00005555e4d6c9a0
21 swift-frontend  0x00005555e4d66d4c
22 swift-frontend  0x00005555e4d66d00
23 swift-frontend  0x00005555e4d8cd84
24 swift-frontend  0x00005555e4d7568c
25 swift-frontend  0x00005555e4d66f30
26 swift-frontend  0x00005555e4d771c4
27 swift-frontend  0x00005555e47b2884
28 swift-frontend  0x00005555e4492d38
29 swift-frontend  0x00005555e4491d54
30 swift-frontend  0x00005555e44a02cc
31 swift-frontend  0x00005555e44946b4
32 swift-frontend  0x00005555e4493a20
33 swift-frontend  0x00005555e423e718
34 libc.so.6       0x00007fff2bc27740
35 libc.so.6       0x00007fff2bc27818 __libc_start_main + 152
36 swift-frontend  0x00005555e423d870

Expected behavior

The compiler can compile the code successfully.

Environment

$ swiftly list
Installed release toolchains
----------------------------
Swift 6.1.0

Installed snapshot toolchains
-----------------------------
main-snapshot-2025-05-14 (in use) (default)
main-snapshot-2025-05-08
main-snapshot-2025-03-28
6.1-snapshot-2025-03-25
$ swiftc -version
Swift version 6.2-dev (LLVM be9c1978c3677f1, Swift 749e9ee090b6443)
Target: aarch64-unknown-linux-gnu
Build config: +assertions
$ uname -a
Linux Raspberry-beetle 6.12.27-v8-16k+ #1876 SMP PREEMPT Tue May  6 15:14:02 BST 2025 aarch64 GNU/Linux

Additional information

This issue can be reproduced on macOS too.

$ sw_vers
ProductName:            macOS
ProductVersion:         15.5
BuildVersion:           24F74
$ cat test.swift
@available(macOS 9999, *)
let a: InlineArray<_, UInt8> = [0]
$ swiftc -version
Apple Swift version 6.2-dev (LLVM be9c1978c3677f1, Swift 749e9ee090b6443)
Target: arm64-apple-macosx15.0
Build config: +assertions
$ swiftc -c -parse-as-library -swift-version 6 -v test.swift
Apple Swift version 6.2-dev (LLVM be9c1978c3677f1, Swift 749e9ee090b6443)
Target: arm64-apple-macosx15.0
/Users/kebo/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-05-14-a.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file test.swift -target arm64-apple-macosx15.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -no-color-diagnostics -Xcc -fno-color-diagnostics -swift-version 6 -empty-abi-descriptor -no-auto-bridging-header-chaining -module-name test -in-process-plugin-server-path /Users/kebo/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-05-14-a.xctoolchain/usr/lib/swift/host/libSwiftInProcPluginServer.dylib -plugin-path /Users/kebo/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-05-14-a.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Users/kebo/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-05-14-a.xctoolchain/usr/local/lib/swift/host/plugins -parse-as-library -o test.o
Assertion failed: ((TranslationSemantics::LookThrough != TranslationSemantics::LookThrough || isStaticallyLookThroughInst(inst)) && "Out of sync?!"), function visitVectorBaseAddrInst, file RegionAnalysis.cpp, line 3414.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0.	Program arguments: /Users/kebo/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-05-14-a.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file test.swift -target arm64-apple-macosx15.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -no-color-diagnostics -Xcc -fno-color-diagnostics -swift-version 6 -empty-abi-descriptor -no-auto-bridging-header-chaining -module-name test -in-process-plugin-server-path /Users/kebo/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-05-14-a.xctoolchain/usr/lib/swift/host/libSwiftInProcPluginServer.dylib -plugin-path /Users/kebo/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-05-14-a.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Users/kebo/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-05-14-a.xctoolchain/usr/local/lib/swift/host/plugins -parse-as-library -o test.o
1.	Apple Swift version 6.2-dev (LLVM be9c1978c3677f1, Swift 749e9ee090b6443)
2.	Compiling with the current language version
3.	While evaluating request ExecuteSILPipelineRequest(Run pipelines { Mandatory Diagnostic Passes + Enabling Optimization Passes } on SIL for test)
4.	While running pass #24 SILFunctionTransform "SendNonSendable" on SILFunction "@$s4test1a_WZ".
 for declaration 0x1289f8088 (at test.swift:2:1)
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  swift-frontend           0x000000010666ef94 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  swift-frontend           0x000000010666d6c0 llvm::sys::RunSignalHandlers() + 112
2  swift-frontend           0x000000010666f5dc SignalHandler(int, __siginfo*, void*) + 296
3  libsystem_platform.dylib 0x000000019fc5c624 _sigtramp + 56
4  libsystem_pthread.dylib  0x000000019fc2288c pthread_kill + 296
5  libsystem_c.dylib        0x000000019fb2bc60 abort + 124
6  libsystem_c.dylib        0x000000019fb2aeec err + 0
7  swift-frontend           0x00000001066a5a70 swift::regionanalysisimpl::PartitionOpTranslator::visitTupleInst(swift::TupleInst*) (.cold.1) + 0
8  swift-frontend           0x00000001016803f8 decltype(auto) llvm::cast<swift::VectorBaseAddrInst, swift::SILInstruction>(swift::SILInstruction*) + 0
9  swift-frontend           0x000000010167c1cc swift::regionanalysisimpl::PartitionOpTranslator::translateSILInstruction(swift::SILInstruction*)::'lambda0'()::operator()() const + 1716
10 swift-frontend           0x000000010167aec4 swift::regionanalysisimpl::PartitionOpTranslator::translateSILInstruction(swift::SILInstruction*) + 96
11 swift-frontend           0x00000001016750bc swift::regionanalysisimpl::PartitionOpTranslator::translateSILBasicBlock(swift::SILBasicBlock*, std::__1::vector<swift::PartitionOp, std::__1::allocator<swift::PartitionOp>>&) + 768
12 swift-frontend           0x0000000101695908 swift::BasicBlockData<swift::regionanalysisimpl::BlockPartitionState, 32u>::BasicBlockData(swift::SILFunction*, llvm::function_ref<swift::regionanalysisimpl::BlockPartitionState (swift::SILBasicBlock*)>) + 192
13 swift-frontend           0x00000001016769f8 swift::RegionAnalysisFunctionInfo::RegionAnalysisFunctionInfo(swift::SILFunction*, swift::PostOrderFunctionInfo*) + 588
14 swift-frontend           0x0000000101677d78 swift::RegionAnalysis::newFunctionAnalysis(swift::SILFunction*) + 56
15 swift-frontend           0x00000001018bccc4 swift::FunctionAnalysisBase<swift::RegionAnalysisFunctionInfo>::get(swift::SILFunction*) + 80
16 swift-frontend           0x00000001018bb24c (anonymous namespace)::SendNonSendable::run() + 140
17 swift-frontend           0x00000001018df364 swift::SILPassManager::runPassOnFunction(unsigned int, swift::SILFunction*) + 1344
18 swift-frontend           0x00000001018e0088 swift::SILPassManager::runFunctionPasses(unsigned int, unsigned int) + 1060
19 swift-frontend           0x00000001018e2890 swift::SILPassManager::execute() + 596
20 swift-frontend           0x00000001018dd2a8 swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) + 72
21 swift-frontend           0x00000001018dd228 swift::ExecuteSILPipelineRequest::evaluate(swift::Evaluator&, swift::SILPipelineExecutionDescriptor) const + 68
22 swift-frontend           0x0000000101902cd8 swift::SimpleRequest<swift::ExecuteSILPipelineRequest, std::__1::tuple<> (swift::SILPipelineExecutionDescriptor), (swift::RequestFlags)1>::evaluateRequest(swift::ExecuteSILPipelineRequest const&, swift::Evaluator&) + 28
23 swift-frontend           0x00000001018e4438 swift::ExecuteSILPipelineRequest::OutputType swift::Evaluator::getResultUncached<swift::ExecuteSILPipelineRequest, swift::ExecuteSILPipelineRequest::OutputType swift::evaluateOrFatal<swift::ExecuteSILPipelineRequest>(swift::Evaluator&, swift::ExecuteSILPipelineRequest)::'lambda'()>(swift::ExecuteSILPipelineRequest const&, swift::ExecuteSILPipelineRequest::OutputType swift::evaluateOrFatal<swift::ExecuteSILPipelineRequest>(swift::Evaluator&, swift::ExecuteSILPipelineRequest)::'lambda'()) + 204
24 swift-frontend           0x00000001018dd498 swift::executePassPipelinePlan(swift::SILModule*, swift::SILPassPipelinePlan const&, bool, swift::irgen::IRGenModule*) + 64
25 swift-frontend           0x00000001018e5a0c swift::runSILDiagnosticPasses(swift::SILModule&) + 192
26 swift-frontend           0x0000000101181fa8 swift::CompilerInstance::performSILProcessing(swift::SILModule*) + 80
27 swift-frontend           0x0000000100f47534 performCompileStepsPostSILGen(swift::CompilerInstance&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) + 820
28 swift-frontend           0x0000000100f46b94 swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 468
29 swift-frontend           0x0000000100f53264 withSemanticAnalysis(swift::CompilerInstance&, swift::FrontendObserver*, llvm::function_ref<bool (swift::CompilerInstance&)>, bool) + 164
30 swift-frontend           0x0000000100f4898c performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 716
31 swift-frontend           0x0000000100f48148 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2312
32 swift-frontend           0x0000000100cdd394 swift::mainEntry(int, char const**) + 3064
33 dyld                     0x000000019f882b98 start + 6076

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.crashBug: A crash, i.e., an abnormal termination of softwaretriage neededThis issue needs more specific labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions