Skip to content

[SR-6800] Swift 4.1 regression: compiler crash with optimizations (instrprof failed to lower an increment UNREACHABLE executed) #49349

@NachoSoto

Description

@NachoSoto
Previous ID SR-6800
Radar rdar://problem/36675957
Original Reporter @NachoSoto
Type Bug
Status Resolved
Resolution Duplicate
Environment

Swift version 4.1-dev (LLVM ef53654946, Clang f7df1e5a04, Swift 831b78c)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, 4.1Regression, CompilerCrash
Assignee @vedantk
Priority Medium

md5: 3dabdb63c4ad6cef364d7b857ba5162c

blocks:

  • SR-6846 Swift 4.1 compiler crash with optimization

Issue Description:

After converting AsyncImageView to Swift 4.1, I compiled it with Carthage and realized it crashes the compiler (not in Debug). You can clone the branch on that exact state from the repo or download it directly from here.

Once open, select the AsyncImageView-iOS scheme and compile (I already set it to Release configuration).

Stack trace:

instrprof failed to lower an increment
UNREACHABLE executed at /Users/buildnode/jenkins/workspace/oss-swift-4.1-package-osx/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:5850!
0  swift                    0x000000010e104ab8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  swift                    0x000000010e103a06 llvm::sys::RunSignalHandlers() + 86
2  swift                    0x000000010e10507e SignalHandler(int) + 366
3  libsystem_platform.dylib 0x00007fff54770f5a _sigtramp + 26
4  libsystem_platform.dylib 0x000000011a41b558 _sigtramp + 3318392344
5  libsystem_c.dylib        0x00007fff5459b312 abort + 127
6  swift                    0x000000010e0a5860 LLVMInstallFatalErrorHandler + 0
7  swift                    0x000000010c7ca6a7 llvm::SelectionDAGBuilder::visitIntrinsicCall(llvm::CallInst const&, unsigned int) + 43127
8  swift                    0x000000010c7a704f llvm::SelectionDAGBuilder::visitCall(llvm::CallInst const&) + 239
9  swift                    0x000000010c79d5b9 llvm::SelectionDAGBuilder::visit(llvm::Instruction const&) + 105
10 swift                    0x000000010c8266cf llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void>, false, true>, llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void>, false, true>, bool&) + 127
11 swift                    0x000000010c82588f llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 7423
12 swift                    0x000000010c822ad3 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 2035
13 swift                    0x000000010bed6434 (anonymous namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 20
14 swift                    0x000000010cb9fa1c llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 172
15 swift                    0x000000010dfed4ad llvm::FPPassManager::runOnFunction(llvm::Function&) + 509
16 swift                    0x000000010dfed723 llvm::FPPassManager::runOnModule(llvm::Module&) + 67
17 swift                    0x000000010dfedba0 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 752
18 swift                    0x000000010ade492d swift::performLLVM(swift::IRGenOptions&, swift::DiagnosticEngine*, llvm::sys::SmartMutex<false>*, llvm::GlobalVariable*, llvm::Module*, llvm::TargetMachine*, swift::version::Version const&, llvm::StringRef, swift::UnifiedStatsReporter*) + 3485
19 swift                    0x000000010ade9755 ThreadEntryPoint(swift::irgen::IRGenerator*, llvm::sys::SmartMutex<false>*, int) + 517
20 swift                    0x000000010adea86f void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(swift::irgen::IRGenerator*, llvm::sys::SmartMutex<false>*, int), swift::irgen::IRGenerator*, llvm::sys::SmartMutex<false>*, int> >(void*) + 47
21 libsystem_pthread.dylib  0x00007fff5477a6c1 _pthread_body + 340
22 libsystem_pthread.dylib  0x00007fff5477a56d _pthread_body + 0
23 libsystem_pthread.dylib  0x00007fff54779c5d thread_start + 13
Stack dump:
0.  Running pass 'Function Pass Manager' on module '/Users/nachosoto/Library/Developer/Xcode/DerivedData/Build/Intermediates/AsyncImageView.build/Release-iphonesimulator/AsyncImageView-iOS.build/Objects-normal/x86_64/Renderer.o'.
1.  Running pass 'X86 DAG->DAG Instruction Selection' on function '@_T014AsyncImageViewAACAByxq_q0_q1_GSC6CGRectV12initialFrame_q0_8rendererq1_Sg19placeholderRenderer13ReactiveSwift9Scheduler_p02uiL0AjK_p013imageCreationL0tcfcfA2_'

See also SR-6797 and SR-6799.

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of softwareregressionswift 4.1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions