I submitted this to Feedback Assistant as FB22331090 and wanted to share a minimal reproducible example here in case others are seeing the same issue.
Environment:
- Xcode 26.4 or Xcode 26.3
- Apple Swift version 6.3 (swiftlang-6.3.0.123.5 clang-2100.0.123.102)
- Effective Swift language version 5.10
- Deployment target: iOS 17.0
The sample app builds successfully for normal development use, but archive fails.
The crash happens during optimization in EarlyPerfInliner while compiling the synthesized deinit of a nested generic Coordinator class. The coordinator stores a UIHostingController<Content>.
Minimal reproducer:
import SwiftUI
struct ReproView<Content: View>: UIViewRepresentable {
let content: Content
func makeUIView(context: Context) -> UIView {
context.coordinator.host.view
}
func updateUIView(_ uiView: UIView, context: Context) {
context.coordinator.host.rootView = content
}
func makeCoordinator() -> Coordinator {
Coordinator(content: content)
}
final class Coordinator {
let host: UIHostingController<Content>
init(content: Content) {
host = UIHostingController(rootView: content)
}
}
}
Used from ContentView like this:
ReproView(content: Text("Hello"))
Steps:
- Create a new SwiftUI iOS app.
- Set deployment target to iOS 17.0.
- Add the code above.
- Archive.
Expected result:
Archive succeeds, or the compiler emits a normal diagnostic.
Actual result:
The Swift compiler crashes and prints:
"Please submit a bug report"
"While running pass ... SILFunctionTransform 'EarlyPerfInliner'"
The crash occurs while compiling the synthesized deinit for ReproView.Coordinator.
Relevant log lines from my archive log:
line 209: Please submit a bug report
line 215: While running pass ... EarlyPerfInliner
line 216: for 'deinit' at ReproView.swift:19:17
One more detail:
The same sample archived successfully when the deployment target was higher. Lowering the deployment target to iOS 17.0 made the archive crash reproducible.
This may be related to another forum thread about release-only compiler crashes, but the reproducer here is different: this one uses a generic UIViewRepresentable with a nested Coordinator storing UIHostingController<Content>.