[clang] [lld] [lld-macho][draft]Allow folding entries with identical FDE (PR #216895)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 18 08:57:12 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results

* 3170 tests passed
* 66 tests skipped
* 2 tests failed

## Failed Tests
(click on a test name to see its output)

### lld
<details>
<summary>lld.MachO/icf-safe.ll</summary>

```
Exit Code: 3221225501

Command Output (stdout):
--
# RUN: at line 3
rm -rf C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf-safe.ll.tmp; mkdir C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf-safe.ll.tmp
# executed command: rm -rf 'C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf-safe.ll.tmp'
# note: command had no output on stdout or stderr
# executed command: mkdir 'C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf-safe.ll.tmp'
# note: command had no output on stdout or stderr
# RUN: at line 5
c:\_work\llvm-project\llvm-project\build\bin\llc.exe -filetype=obj C:\_work\llvm-project\llvm-project\lld\test\MachO\icf-safe.ll -O3 -o C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf-safe.ll.tmp/icf-obj.o -enable-machine-outliner=never -mtriple arm64-apple-macos -addrsig
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llc.exe' -filetype=obj 'C:\_work\llvm-project\llvm-project\lld\test\MachO\icf-safe.ll' -O3 -o 'C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf-safe.ll.tmp/icf-obj.o' -enable-machine-outliner=never -mtriple arm64-apple-macos -addrsig
# note: command had no output on stdout or stderr
# RUN: at line 6
ld64.lld -arch x86_64 -platform_version macos 11.0 11.0 -syslibroot C:\_work\llvm-project\llvm-project\lld\test\MachO\Inputs\MacOSX.sdk -lSystem -fatal_warnings -arch arm64 -lSystem --icf=safe -dylib -o C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf-safe.ll.tmp/icf-safe.dylib C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf-safe.ll.tmp/icf-obj.o
# executed command: ld64.lld -arch x86_64 -platform_version macos 11.0 11.0 -syslibroot 'C:\_work\llvm-project\llvm-project\lld\test\MachO\Inputs\MacOSX.sdk' -lSystem -fatal_warnings -arch arm64 -lSystem --icf=safe -dylib -o 'C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf-safe.ll.tmp/icf-safe.dylib' 'C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf-safe.ll.tmp/icf-obj.o'
# .---command stderr------------
# | invalid r_length
# | UNREACHABLE executed at C:\_work\llvm-project\llvm-project\lld\MachO\Arch\ARM64Common.cpp:51!
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
# | Stack dump:
# | 0.	Program arguments: ld64.lld -arch x86_64 -platform_version macos 11.0 11.0 -syslibroot C:\\_work\\llvm-project\\llvm-project\\lld\\test\\MachO\\Inputs\\MacOSX.sdk -lSystem -fatal_warnings -arch arm64 -lSystem --icf=safe -dylib -o C:\\_work\\llvm-project\\llvm-project\\build\\tools\\lld\\test\\MachO\\Output\\icf-safe.ll.tmp/icf-safe.dylib C:\\_work\\llvm-project\\llvm-project\\build\\tools\\lld\\test\\MachO\\Output\\icf-safe.ll.tmp/icf-obj.o
# | Exception Code: 0xC000001D
# | #0 0x00007ffda3f2f46c (C:\Windows\System32\KERNELBASE.dll+0x3f46c)
# | #1 0x00007ff73114aa81 (c:\_work\llvm-project\llvm-project\build\bin\ld64.lld.exe+0x1aa81)
# | #2 0x00007ff73115758e (c:\_work\llvm-project\llvm-project\build\bin\ld64.lld.exe+0x2758e)
# | #3 0x00007ff731131426 (c:\_work\llvm-project\llvm-project\build\bin\ld64.lld.exe+0x1426)
# | #4 0x00007ff731131a8c (c:\_work\llvm-project\llvm-project\build\bin\ld64.lld.exe+0x1a8c)
# | #5 0x00007ff7362c2f20 (c:\_work\llvm-project\llvm-project\build\bin\ld64.lld.exe+0x5192f20)
# | #6 0x00007ffdb2704cb0 (C:\Windows\System32\KERNEL32.DLL+0x14cb0)
# | #7 0x00007ffdbce1edfb (C:\Windows\SYSTEM32\ntdll.dll+0x7edfb)
# `-----------------------------
# error: command failed with exit status: 0xc000001d

--

```
</details>
<details>
<summary>lld.MachO/icf.s</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
rm -rf C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf.s.tmp; split-file C:\_work\llvm-project\llvm-project\lld\test\MachO\icf.s C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf.s.tmp
# executed command: rm -rf 'C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf.s.tmp'
# note: command had no output on stdout or stderr
# executed command: split-file 'C:\_work\llvm-project\llvm-project\lld\test\MachO\icf.s' 'C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf.s.tmp'
# note: command had no output on stdout or stderr
# RUN: at line 10
c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe -emit-compact-unwind-non-canonical=true -filetype=obj -triple=x86_64-apple-darwin19.0.0 C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf.s.tmp/main.s -o C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf.s.tmp/main.o
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe' -emit-compact-unwind-non-canonical=true -filetype=obj -triple=x86_64-apple-darwin19.0.0 'C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf.s.tmp/main.s' -o 'C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf.s.tmp/main.o'
# note: command had no output on stdout or stderr
# RUN: at line 11
c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe -emit-compact-unwind-non-canonical=true -filetype=obj -triple=x86_64-apple-darwin19.0.0 C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf.s.tmp/abs.s -o C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf.s.tmp/abs.o
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llvm-mc.exe' -emit-compact-unwind-non-canonical=true -filetype=obj -triple=x86_64-apple-darwin19.0.0 'C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf.s.tmp/abs.s' -o 'C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf.s.tmp/abs.o'
# note: command had no output on stdout or stderr
# RUN: at line 12
ld64.lld -arch x86_64 -platform_version macos 11.0 11.0 -syslibroot C:\_work\llvm-project\llvm-project\lld\test\MachO\Inputs\MacOSX.sdk -lSystem -fatal_warnings -lSystem --icf=all -o C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf.s.tmp/main C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf.s.tmp/main.o C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf.s.tmp/abs.o
# executed command: ld64.lld -arch x86_64 -platform_version macos 11.0 11.0 -syslibroot 'C:\_work\llvm-project\llvm-project\lld\test\MachO\Inputs\MacOSX.sdk' -lSystem -fatal_warnings -lSystem --icf=all -o 'C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf.s.tmp/main' 'C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf.s.tmp/main.o' 'C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf.s.tmp/abs.o'
# note: command had no output on stdout or stderr
# RUN: at line 13
c:\_work\llvm-project\llvm-project\build\bin\llvm-objdump.exe -d --syms --dwarf=frames C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf.s.tmp/main | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\lld\test\MachO\icf.s
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llvm-objdump.exe' -d --syms --dwarf=frames 'C:\_work\llvm-project\llvm-project\build\tools\lld\test\MachO\Output\icf.s.tmp/main'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\lld\test\MachO\icf.s'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\lld\test\MachO\icf.s:60:10: error: CHECK: expected string not found in input
# | # CHECK: FDE {{.*}} pc=[[#%x,HAS_EH_FRAME_2]]
# |          ^
# | <stdin>:81:57: note: scanning from here
# | 00000018 0000001c 0000001c FDE cie=00000000 pc=1000006b3...1000006b4
# |                                                         ^
# | <stdin>:81:57: note: with "%x,HAS_EH_FRAME_2" equal to "1000006b3"
# | 00000018 0000001c 0000001c FDE cie=00000000 pc=1000006b3...1000006b4
# |                                                         ^
# | <stdin>:91:28: note: possible intended match here
# | 00000038 0000001c 0000003c FDE cie=00000000 pc=1000006b4...1000006b6
# |                            ^
# | C:\_work\llvm-project\llvm-project\lld\test\MachO\icf.s:92:10: error: CHECK: expected string not found in input
# | # CHECK: callq 0x[[#%x,HAS_EH_FRAME_1]] <_has_eh_frame_1>
# |          ^
# | <stdin>:273:69: note: scanning from here
# | 100000767: e8 46 ff ff ff callq 0x1000006b2 <_has_abs_personality_2>
# |                                                                     ^
# | <stdin>:273:69: note: with "%x,HAS_EH_FRAME_1" equal to "1000006b3"
# | 100000767: e8 46 ff ff ff callq 0x1000006b2 <_has_abs_personality_2>
# |                                                                     ^
# | <stdin>:274:36: note: possible intended match here
# | 10000076c: e8 42 ff ff ff callq 0x1000006b3 <_has_eh_frame_2>
# |                                    ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\lld\test\MachO\icf.s
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |            76:  DW_CFA_nop: 
# |            77:  DW_CFA_nop: 
# |            78:  
# |            79:  CFA=reg7+8: reg16=[CFA-8] 
# |            80:  
# |            81: 00000018 0000001c 0000001c FDE cie=00000000 pc=1000006b3...1000006b4 
# | check:60'0                                                            {               search range start (exclusive)
# | check:60'1                                                                            error: no match found in search range
# | check:60'2                                                                            with "%x,HAS_EH_FRAME_2" equal to "1000006b3"
# |            82:  Format: DWARF32 
# |            83:  DW_CFA_def_cfa_offset: +8 
# |            84:  DW_CFA_GNU_args_size: +16 
# |            85:  DW_CFA_nop: 
# |            86:  DW_CFA_nop: 
# |            87:  DW_CFA_nop: 
# |            88:  
# |            89:  0x1000006b3: CFA=reg7+8: reg16=[CFA-8] 
# |            90:  
# |            91: 00000038 0000001c 0000003c FDE cie=00000000 pc=1000006b4...1000006b6 
# | check:60'3                                ?                                           possible intended match
# |            92:  Format: DWARF32 
# |            93:  DW_CFA_def_cfa_offset: +8 
# |            94:  DW_CFA_GNU_args_size: +16 
# |            95:  DW_CFA_nop: 
# |            96:  DW_CFA_nop: 
# |             .
# |             .
# |             .
# |           144:  DW_CFA_nop: 
# |           145:  
# |           146:  CFA=reg7+8: reg16=[CFA-8] 
# |           147:  
# |           148:  
# |           149: Disassembly of section __TEXT,__text: 
# | check:60'4                                          }  search range end (exclusive)
# |           150:  
# |           151: 0000000100000628 <_abs1b_ref>: 
# |           152: 100000628: 48 ba c3 fa 00 00 00 00 00 00 movabsq $0xfac3, %rdx ## imm = 0xFAC3 
# |           153:  
# |           154: 0000000100000632 <_abs1b_ref_with_addend>: 
# |             .
# |             .
# |             .
# |           268: 10000074e: e8 5b ff ff ff callq 0x1000006ae <_has_unwind_2> 
# |           269: 100000753: e8 56 ff ff ff callq 0x1000006ae <_has_unwind_2> 
# |           270: 100000758: e8 52 ff ff ff callq 0x1000006af <_has_unwind_3> 
# |           271: 10000075d: e8 4e ff ff ff callq 0x1000006b0 <_has_unwind_4> 
# |           272: 100000762: e8 4a ff ff ff callq 0x1000006b1 <_has_abs_personality_1> 
# |           273: 100000767: e8 46 ff ff ff callq 0x1000006b2 <_has_abs_personality_2> 
# | check:92'0                                                                        {   search range start (exclusive)
# | check:92'1                                                                            error: no match found in search range
# | check:92'2                                                                            with "%x,HAS_EH_FRAME_1" equal to "1000006b3"
# |           274: 10000076c: e8 42 ff ff ff callq 0x1000006b3 <_has_eh_frame_2> 
# | check:92'3                                        ?                            possible intended match
# |           275: 100000771: e8 3d ff ff ff callq 0x1000006b3 <_has_eh_frame_2> 
# |           276: 100000776: e8 39 ff ff ff callq 0x1000006b4 <_has_eh_frame_3> 
# |           277: 10000077b: e8 36 ff ff ff callq 0x1000006b6 <_mutually_recursive_2> 
# |           278: 100000780: e8 31 ff ff ff callq 0x1000006b6 <_mutually_recursive_2> 
# |           279: 100000785: e8 36 ff ff ff callq 0x1000006c0 <_asymmetric_recursive_1> 
# |             .
# |             .
# |             .
# |           296: 1000007b5: ff 25 6d 18 00 00 jmpq *0x186d(%rip) ## 0x100002028 <_abs1b+0xffff2565> 
# |           297: 1000007bb: 90 nop 
# |           298: 1000007bc: 68 00 00 00 00 pushq $0x0 
# |           299: 1000007c1: e9 e6 ff ff ff jmp 0x1000007ac <__stub_helper> 
# |           300: 1000007c6: 68 0f 00 00 00 pushq $0xf 
# |           301: 1000007cb: e9 dc ff ff ff jmp 0x1000007ac <__stub_helper> 
# | check:92'4                                                               } search range end (exclusive)
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

https://github.com/llvm/llvm-project/pull/216895


More information about the llvm-commits mailing list