Issue 180277
Summary Branch coverage (single-byte counters) causes symbol redefinition error in inline assembly
Labels coverage
Assignees
Reporter gulfemsavrun
    The support of single-byte counters for branch coverage has triggered a build failure in our code in [(arch-boot-zbi.cc).](https://cs.opensource.google/fuchsia/fuchsia/+/main:zircon/kernel/arch/arm64/phys/arch-boot-zbi.cc;l=55;drc=694892ad035d97638cb278997b92e28537318e79) The patch appears to cause a basic block containing inline assembly to be duplicated. Since the assembly has a hardcoded local label (`.L.ZbiBoot.disable_el2`), the duplication results in a `symbol already defined` error during compilation. 
```
./arch-boot-zbi-f1fdbd.sh
../../zircon/kernel/arch/arm64/phys/arch-boot-zbi.cc:58:1: error: symbol '.L.ZbiBoot.disable_el2' is already defined
   58 | .L.ZbiBoot.disable_el2:
      | ^
<inline asm>:3:1: note: instantiated into assembly here
    3 | .L.ZbiBoot.disable_el2:
      | ^
../../zircon/kernel/arch/arm64/phys/arch-boot-zbi.cc:60:1: error: symbol '.L.ZbiBoot.mmu_possibly_off' is already defined
   60 | .L.ZbiBoot.mmu_possibly_off:
      | ^
<inline asm>:5:1: note: instantiated into assembly here
    5 | .L.ZbiBoot.mmu_possibly_off:
      | ^
../../zircon/kernel/arch/arm64/phys/arch-boot-zbi.cc:62:1: error: symbol '.L.ZbiBoot.disable_el1' is already defined
   62 | .L.ZbiBoot.disable_el1:
      | ^
<inline asm>:7:1: note: instantiated into assembly here
    7 | .L.ZbiBoot.disable_el1:
      | ^
../../zircon/kernel/arch/arm64/phys/arch-boot-zbi.cc:64:1: error: symbol '.L.ZbiBoot.mmu_off' is already defined
   64 | .L.ZbiBoot.mmu_off:
      | ^
<inline asm>:9:1: note: instantiated into assembly here
    9 | .L.ZbiBoot.mmu_off:
      | ^
../../zircon/kernel/arch/arm64/phys/arch-boot-zbi.cc:75:1: error: symbol '.L.ZbiBoot.end' is already defined
   75 | .L.ZbiBoot.end:
      | ^
<inline asm>:20:1: note: instantiated into assembly here
   20 | .L.ZbiBoot.end:
      | ^
5 errors generated.
```

I bisected the issue to this [commit](https://github.com/llvm/llvm-project/pull/113111)

I'm attaching a reproducer. [clang-crashreports.zip](https://github.com/user-attachments/files/25136648/clang-crashreports.zip)


_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to