Skip to content

[BranchFolding] Kill common hoisted debug instructions #149999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jul 25, 2025

Conversation

OCHyams
Copy link
Contributor

@OCHyams OCHyams commented Jul 22, 2025

Mirror of #140091 with an assertion failure fixed in the latest commit as a DBG_PHI was tripping a checking in setDebugValueUndef - @jmorse does the last commit look alright to you?

Reproducer shared here - #140091 (comment)

@llvmbot
Copy link
Member

llvmbot commented Jul 22, 2025

@llvm/pr-subscribers-debuginfo

Author: Orlando Cazalet-Hyams (OCHyams)

Changes

Mirror of #140091 with an assertion failure fixed in the latest commit as a DBG_PHI was tripping a checking in setDebugValueUndef - @jmorse does the last commit look alright to you?

Reproducer shared here - #140091 (comment)


Full diff: https://github.com/llvm/llvm-project/pull/149999.diff

2 Files Affected:

  • (modified) llvm/lib/CodeGen/BranchFolding.cpp (+44-6)
  • (modified) llvm/test/DebugInfo/X86/branch-folder-dbg.mir (+24-13)
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp
index 3b3e7a418feb5..1cb0a239c3d48 100644
--- a/llvm/lib/CodeGen/BranchFolding.cpp
+++ b/llvm/lib/CodeGen/BranchFolding.cpp
@@ -2083,22 +2083,59 @@ bool BranchFolder::HoistCommonCodeInSuccs(MachineBasicBlock *MBB) {
   if (TBB == FBB) {
     MBB->splice(Loc, TBB, TBB->begin(), TIB);
   } else {
+    // Merge the debug locations, and hoist and kill the debug instructions from
+    // both branches. FIXME: We could probably try harder to preserve some debug
+    // instructions (but at least this isn't producing wrong locations).
+    MachineInstrBuilder MIRBuilder(*MBB->getParent(), Loc);
+    auto HoistAndKillDbgInstr = [MBB, Loc](MachineBasicBlock::iterator DI) {
+      assert(DI->isDebugInstr() && "Expected a debug instruction");
+      if (DI->isDebugRef()) {
+        const TargetInstrInfo *TII =
+            MBB->getParent()->getSubtarget().getInstrInfo();
+        const MCInstrDesc &DBGV = TII->get(TargetOpcode::DBG_VALUE);
+        DI = BuildMI(*MBB->getParent(), DI->getDebugLoc(), DBGV, false, 0,
+                     DI->getDebugVariable(), DI->getDebugExpression());
+        MBB->insert(Loc, &*DI);
+        return;
+      }
+      // Deleting a DBG_PHI results in an undef at the referenced DBG_INSTR_REF.
+      if (DI->isDebugPHI()) {
+        DI->eraseFromParent();
+        return;
+      }
+
+      DI->setDebugValueUndef();
+      DI->moveBefore(&*Loc);
+    };
+
     // TIB and FIB point to the end of the regions to hoist/merge in TBB and
     // FBB.
     MachineBasicBlock::iterator FE = FIB;
     MachineBasicBlock::iterator FI = FBB->begin();
     for (MachineBasicBlock::iterator TI :
          make_early_inc_range(make_range(TBB->begin(), TIB))) {
-      // Move debug instructions and pseudo probes without modifying them.
-      // FIXME: This is the wrong thing to do for debug locations, which
-      // should at least be killed (and hoisted from BOTH blocks).
-      if (TI->isDebugOrPseudoInstr()) {
-        TI->moveBefore(&*Loc);
+      // Hoist and kill debug instructions from FBB. After this loop FI points
+      // to the next non-debug instruction to hoist (checked in assert after the
+      // TBB debug instruction handling code).
+      while (FI->isDebugInstr()) {
+        assert(FI != FE && "Unexpected end of FBB range");
+        MachineBasicBlock::iterator FINext = std::next(FI);
+        HoistAndKillDbgInstr(FI);
+        FI = FINext;
+      }
+
+      // Kill debug instructions before moving.
+      if (TI->isDebugInstr()) {
+        HoistAndKillDbgInstr(TI);
         continue;
       }
 
-      // Get the next non-meta instruction in FBB.
+      // If FI is a debug instruction, skip forward to the next non-debug
+      // instruction.
       FI = skipDebugInstructionsForward(FI, FE, false);
+      // Pseudo probes are excluded from the range when identifying foldable
+      // instructions, so we don't expect to see one now.
+      assert(!TI->isPseudoProbe() && "Unexpected pseudo probe in range");
       // NOTE: The loop above checks CheckKillDead but we can't do that here as
       // it modifies some kill markers after the check.
       assert(TI->isIdenticalTo(*FI, MachineInstr::CheckDefs) &&
@@ -2111,6 +2148,7 @@ bool BranchFolder::HoistCommonCodeInSuccs(MachineBasicBlock *MBB) {
       ++FI;
     }
   }
+
   FBB->erase(FBB->begin(), FIB);
 
   if (UpdateLiveIns)
diff --git a/llvm/test/DebugInfo/X86/branch-folder-dbg.mir b/llvm/test/DebugInfo/X86/branch-folder-dbg.mir
index 5c38fd2a43829..717bfc28b4065 100644
--- a/llvm/test/DebugInfo/X86/branch-folder-dbg.mir
+++ b/llvm/test/DebugInfo/X86/branch-folder-dbg.mir
@@ -1,16 +1,23 @@
 # RUN: llc %s --start-before=branch-folder --stop-after=branch-folder -o - | FileCheck %s
 
 ## Check that common instructions hoisted from `if.then` and `if.else` into
-## common pred `entry` get merged debug locations.
-
-## FIXME: The debug instructions handling here is wrong.
+## common pred `entry` get merged debug locations. The debug instructions from
+## both branches should get hoisted and killed.
+##
+## The MIR debug instructions have been modified by hand in order to check they
+## can be killed.
+##
+## Check DBG_PHIs are deleted rather than hoisted.
 
 # CHECK: bb.0
 # CHECK:      CALL64pcrel32 @f, csr_64, implicit $rsp, implicit $ssp, implicit-def $rsp, implicit-def $ssp, implicit-def $rax
-## --- Start splice from bb.2.if.else ---
-# CHECK-NEXT: DBG_VALUE 2, $noreg, ![[#]], !DIExpression(),  debug-location ![[#]]
-# CHECK-NEXT: $edi = MOV32r0 implicit-def dead $eflags,  debug-location !DILocation(line: 0, scope: ![[#]])
-## --- End splice --------------
+## --- Start splice from bb.2.if.else (and debug instructions from bb.1.if.then) ---
+# CHECK-NEXT: DBG_VALUE $noreg, $noreg, ![[#]], !DIExpression(),  debug-location ![[#]]
+# CHECK-NEXT: DBG_VALUE $noreg, $noreg, ![[#]], !DIExpression(),  debug-location ![[#]]
+# CHECK-NEXT: $edi = MOV32r0 implicit-def dead $eflags, debug-instr-number 2, debug-location !DILocation(line: 0, scope: ![[#]])
+# CHECK-NEXT: DBG_VALUE $noreg, $noreg, ![[#]], !DIExpression(DW_OP_LLVM_arg, 0),  debug-location ![[#]]
+# CHECK-NEXT: DBG_VALUE $noreg, $noreg, ![[#]], !DIExpression(DW_OP_LLVM_arg, 0),  debug-location ![[#]]
+## --- End splice ------------------------------------------------------------------
 # CHECK-NEXT: TEST64rr killed renamable $rax, renamable $rax, implicit-def $eflags
 # CHECK-NEXT: JCC_1 %bb.2, 9, implicit killed $eflags
 # CHECK: bb.1
@@ -73,6 +80,8 @@
 ...
 ---
 name:            g
+tracksRegLiveness: true
+isSSA: false
 body:             |
   bb.0 (%ir-block.0):
     successors: %bb.1(0x40000000), %bb.2(0x40000000)
@@ -87,21 +96,23 @@ body:             |
   bb.1.if.then:
     successors: %bb.3(0x80000000)
 
-    DBG_VALUE 0, $noreg, !11, !DIExpression(),  debug-location !13
-    $edi = MOV32r0 implicit-def dead $eflags,  debug-location !14
+    DBG_PHI $esp, 3
+    DBG_VALUE $esi, $noreg, !11, !DIExpression(),  debug-location !13
+    $edi = MOV32r0 implicit-def dead $eflags, debug-instr-number 1, debug-location !14
+    DBG_INSTR_REF !11, !DIExpression(DW_OP_LLVM_arg, 0), dbg-instr-ref(1, 0),  debug-location !13
     $esi = MOV32r0 implicit-def dead $eflags,  debug-location !14
     CALL64pcrel32 target-flags(x86-plt) @_Z3fooii, csr_64, implicit $rsp, implicit $ssp, implicit killed $edi, implicit killed $esi, implicit-def $rsp, implicit-def $ssp,  debug-location !14
-    DBG_VALUE 1, $noreg, !11, !DIExpression(),  debug-location !13
     JMP_1 %bb.3,  debug-location !15
 
   bb.2.if.else:
     successors: %bb.3(0x80000000)
 
-    DBG_VALUE 2, $noreg, !11, !DIExpression(),  debug-location !13
-    $edi = MOV32r0 implicit-def dead $eflags,  debug-location !16
+    DBG_PHI $esp, 4
+    DBG_VALUE $esp, $noreg, !11, !DIExpression(), debug-location !13
+    $edi = MOV32r0 implicit-def dead $eflags, debug-instr-number 2, debug-location !16
+    DBG_INSTR_REF !11, !DIExpression(DW_OP_LLVM_arg, 0), dbg-instr-ref(2, 0),  debug-location !13
     $esi = MOV32ri 1,  debug-location !16
     CALL64pcrel32 target-flags(x86-plt) @_Z3barii, csr_64, implicit $rsp, implicit $ssp, implicit killed $edi, implicit killed $esi, implicit-def $rsp, implicit-def $ssp,  debug-location !16
-    DBG_VALUE 3, $noreg, !11, !DIExpression(),  debug-location !13
 
   bb.3.if.end:
     $eax = MOV32ri 2

Copy link
Member

@jmorse jmorse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, presumably the absence of DBG_PHIs is checked by the absence of anything between CHECK-NEXT directives?

OCHyams added 10 commits July 25, 2025 13:33
branch-folder hoists common instructions from TBB and FBB into their
pred. Without this patch it achieves this by splicing the instructions from TBB
and deleting the common ones in FBB. That moves the debug locations and debug
instructions from TBB into the pred without modification, which is not
ideal. Debug locations are handled in llvm#140063.

This patch handles debug instructions - in the simplest way possible, which is
to just kill (undef) them. We kill and hoist the ones in FBB as well as TBB
because otherwise the fact there's an assignment on the code path is deleted
(which might lead to a prior location extending further than it should).

There's possibly something we could do to preserve some variable locations in
some cases, but this is the easiest not-incorrect thing to do.

Note I had to replace the constant DBG_VALUEs to use registers in the test- it
turns out setDebugValueUndef doesn't undef constant DBG_VALUEs... which feels
wrong to me, but isn't something I want to touch right now.
@OCHyams OCHyams force-pushed the branch-fold-dbg-instr2 branch from 337dfbe to f1aaf4d Compare July 25, 2025 12:33
@OCHyams
Copy link
Contributor Author

OCHyams commented Jul 25, 2025

Added an implicit-check-not for good measure

@OCHyams OCHyams merged commit c1545b6 into llvm:main Jul 25, 2025
9 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 25, 2025

LLVM Buildbot has detected a new failure on builder fuchsia-x86_64-linux running on fuchsia-debian-64-us-central1-a-1 while building llvm at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/11/builds/20364

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/fuchsia-linux.py ...' (failure)
...
[499/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_has_single_bit_ul.dir/stdc_has_single_bit_ul.cpp.obj
[500/2522] Building CXX object libc/src/__support/StringUtil/CMakeFiles/libc.src.__support.StringUtil.error_to_string.dir/error_to_string.cpp.obj
[501/2522] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cproj.dir/cproj.cpp.obj
[502/2522] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cprojl.dir/cprojl.cpp.obj
[503/2522] Building CXX object libc/src/__support/CMakeFiles/libc.src.__support.freelist.dir/freelist.cpp.obj
[504/2522] Building CXX object libc/src/__support/CMakeFiles/libc.src.__support.freetrie.dir/freetrie.cpp.obj
[505/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_width_uc.dir/stdc_bit_width_uc.cpp.obj
[506/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_width_us.dir/stdc_bit_width_us.cpp.obj
[507/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_width_ui.dir/stdc_bit_width_ui.cpp.obj
[508/2522] Building CXX object libc/src/stdio/CMakeFiles/libc.src.stdio.vsscanf.dir/vsscanf.cpp.obj
FAILED: libc/src/stdio/CMakeFiles/libc.src.stdio.vsscanf.dir/vsscanf.cpp.obj 
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ce7dk8xu/./bin/clang++ --target=armv7m-none-eabi -DLIBC_NAMESPACE=__llvm_libc_22_0_0_git -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc -isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ce7dk8xu/include/armv7m-unknown-none-eabi --target=armv7m-none-eabi -Wno-atomic-alignment "-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)" "-Dfprintf(stream, format, ...)=printf(format)" "-Dfputs(string, stream)=puts(string)" -D_LIBCPP_PRINT=1 -mthumb -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ce7dk8xu/runtimes/runtimes-armv7m-none-eabi-bins=../../../../llvm-project -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/= -no-canonical-prefixes -Os -DNDEBUG --target=armv7m-none-eabi -DLIBC_QSORT_IMPL=LIBC_QSORT_HEAP_SORT -DLIBC_TYPES_TIME_T_IS_32_BIT -DLIBC_ADD_NULL_CHECKS "-DLIBC_MATH=(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES)" -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_EXTERNAL -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -ffixed-point -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -MD -MT libc/src/stdio/CMakeFiles/libc.src.stdio.vsscanf.dir/vsscanf.cpp.obj -MF libc/src/stdio/CMakeFiles/libc.src.stdio.vsscanf.dir/vsscanf.cpp.obj.d -o libc/src/stdio/CMakeFiles/libc.src.stdio.vsscanf.dir/vsscanf.cpp.obj -c /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdio/vsscanf.cpp
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdio/vsscanf.cpp:14:
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdio/scanf_core/scanf_main.h:14:
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdio/scanf_core/converter.h:15:
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdio/scanf_core/core_structs.h:16:
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ce7dk8xu/./lib/clang/22/include/inttypes.h:24:15: fatal error: 'inttypes.h' file not found
   24 | #include_next <inttypes.h>
      |               ^~~~~~~~~~~~
1 error generated.
[509/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_width_ul.dir/stdc_bit_width_ul.cpp.obj
[510/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_width_ull.dir/stdc_bit_width_ull.cpp.obj
[511/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_floor_ul.dir/stdc_bit_floor_ul.cpp.obj
[512/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_floor_ull.dir/stdc_bit_floor_ull.cpp.obj
[513/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_floor_uc.dir/stdc_bit_floor_uc.cpp.obj
[514/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_floor_us.dir/stdc_bit_floor_us.cpp.obj
[515/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_leading_zero_us.dir/stdc_first_leading_zero_us.cpp.obj
[516/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_ceil_ul.dir/stdc_bit_ceil_ul.cpp.obj
[517/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_floor_ui.dir/stdc_bit_floor_ui.cpp.obj
[518/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_ceil_uc.dir/stdc_bit_ceil_uc.cpp.obj
[519/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_ceil_ui.dir/stdc_bit_ceil_ui.cpp.obj
[520/2522] Building CXX object libc/src/inttypes/CMakeFiles/libc.src.inttypes.imaxabs.dir/imaxabs.cpp.obj
[521/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_leading_one_ui.dir/stdc_first_leading_one_ui.cpp.obj
[522/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_leading_zero_uc.dir/stdc_first_leading_zero_uc.cpp.obj
[523/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_ceil_us.dir/stdc_bit_ceil_us.cpp.obj
[524/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_leading_zero_ui.dir/stdc_first_leading_zero_ui.cpp.obj
[525/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_ceil_ull.dir/stdc_bit_ceil_ull.cpp.obj
[526/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_leading_zero_ull.dir/stdc_first_leading_zero_ull.cpp.obj
[527/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_trailing_zero_ul.dir/stdc_first_trailing_zero_ul.cpp.obj
[528/2522] Building CXX object libc/src/inttypes/CMakeFiles/libc.src.inttypes.imaxdiv.dir/imaxdiv.cpp.obj
[529/2522] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.issignaling.dir/issignaling.cpp.obj
[530/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_leading_zero_ul.dir/stdc_first_leading_zero_ul.cpp.obj
[531/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_leading_one_uc.dir/stdc_first_leading_one_uc.cpp.obj
[532/2522] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.issignalingl.dir/issignalingl.cpp.obj
[533/2522] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.iscanonicall.dir/iscanonicall.cpp.obj
[534/2522] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.issignalingf.dir/issignalingf.cpp.obj
[535/2522] Building CXX object libc/src/__support/CMakeFiles/libc.src.__support.freelist_heap.dir/freelist_heap.cpp.obj
[536/2522] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.iscanonicalf.dir/iscanonicalf.cpp.obj
[537/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_trailing_zero_ull.dir/stdc_first_trailing_zero_ull.cpp.obj
Step 6 (build) failure: build (failure)
...
[499/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_has_single_bit_ul.dir/stdc_has_single_bit_ul.cpp.obj
[500/2522] Building CXX object libc/src/__support/StringUtil/CMakeFiles/libc.src.__support.StringUtil.error_to_string.dir/error_to_string.cpp.obj
[501/2522] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cproj.dir/cproj.cpp.obj
[502/2522] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cprojl.dir/cprojl.cpp.obj
[503/2522] Building CXX object libc/src/__support/CMakeFiles/libc.src.__support.freelist.dir/freelist.cpp.obj
[504/2522] Building CXX object libc/src/__support/CMakeFiles/libc.src.__support.freetrie.dir/freetrie.cpp.obj
[505/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_width_uc.dir/stdc_bit_width_uc.cpp.obj
[506/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_width_us.dir/stdc_bit_width_us.cpp.obj
[507/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_width_ui.dir/stdc_bit_width_ui.cpp.obj
[508/2522] Building CXX object libc/src/stdio/CMakeFiles/libc.src.stdio.vsscanf.dir/vsscanf.cpp.obj
FAILED: libc/src/stdio/CMakeFiles/libc.src.stdio.vsscanf.dir/vsscanf.cpp.obj 
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ce7dk8xu/./bin/clang++ --target=armv7m-none-eabi -DLIBC_NAMESPACE=__llvm_libc_22_0_0_git -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc -isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ce7dk8xu/include/armv7m-unknown-none-eabi --target=armv7m-none-eabi -Wno-atomic-alignment "-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)" "-Dfprintf(stream, format, ...)=printf(format)" "-Dfputs(string, stream)=puts(string)" -D_LIBCPP_PRINT=1 -mthumb -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ce7dk8xu/runtimes/runtimes-armv7m-none-eabi-bins=../../../../llvm-project -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/= -no-canonical-prefixes -Os -DNDEBUG --target=armv7m-none-eabi -DLIBC_QSORT_IMPL=LIBC_QSORT_HEAP_SORT -DLIBC_TYPES_TIME_T_IS_32_BIT -DLIBC_ADD_NULL_CHECKS "-DLIBC_MATH=(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES)" -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_EXTERNAL -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -ffixed-point -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -MD -MT libc/src/stdio/CMakeFiles/libc.src.stdio.vsscanf.dir/vsscanf.cpp.obj -MF libc/src/stdio/CMakeFiles/libc.src.stdio.vsscanf.dir/vsscanf.cpp.obj.d -o libc/src/stdio/CMakeFiles/libc.src.stdio.vsscanf.dir/vsscanf.cpp.obj -c /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdio/vsscanf.cpp
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdio/vsscanf.cpp:14:
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdio/scanf_core/scanf_main.h:14:
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdio/scanf_core/converter.h:15:
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/stdio/scanf_core/core_structs.h:16:
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ce7dk8xu/./lib/clang/22/include/inttypes.h:24:15: fatal error: 'inttypes.h' file not found
   24 | #include_next <inttypes.h>
      |               ^~~~~~~~~~~~
1 error generated.
[509/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_width_ul.dir/stdc_bit_width_ul.cpp.obj
[510/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_width_ull.dir/stdc_bit_width_ull.cpp.obj
[511/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_floor_ul.dir/stdc_bit_floor_ul.cpp.obj
[512/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_floor_ull.dir/stdc_bit_floor_ull.cpp.obj
[513/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_floor_uc.dir/stdc_bit_floor_uc.cpp.obj
[514/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_floor_us.dir/stdc_bit_floor_us.cpp.obj
[515/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_leading_zero_us.dir/stdc_first_leading_zero_us.cpp.obj
[516/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_ceil_ul.dir/stdc_bit_ceil_ul.cpp.obj
[517/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_floor_ui.dir/stdc_bit_floor_ui.cpp.obj
[518/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_ceil_uc.dir/stdc_bit_ceil_uc.cpp.obj
[519/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_ceil_ui.dir/stdc_bit_ceil_ui.cpp.obj
[520/2522] Building CXX object libc/src/inttypes/CMakeFiles/libc.src.inttypes.imaxabs.dir/imaxabs.cpp.obj
[521/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_leading_one_ui.dir/stdc_first_leading_one_ui.cpp.obj
[522/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_leading_zero_uc.dir/stdc_first_leading_zero_uc.cpp.obj
[523/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_ceil_us.dir/stdc_bit_ceil_us.cpp.obj
[524/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_leading_zero_ui.dir/stdc_first_leading_zero_ui.cpp.obj
[525/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_bit_ceil_ull.dir/stdc_bit_ceil_ull.cpp.obj
[526/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_leading_zero_ull.dir/stdc_first_leading_zero_ull.cpp.obj
[527/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_trailing_zero_ul.dir/stdc_first_trailing_zero_ul.cpp.obj
[528/2522] Building CXX object libc/src/inttypes/CMakeFiles/libc.src.inttypes.imaxdiv.dir/imaxdiv.cpp.obj
[529/2522] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.issignaling.dir/issignaling.cpp.obj
[530/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_leading_zero_ul.dir/stdc_first_leading_zero_ul.cpp.obj
[531/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_leading_one_uc.dir/stdc_first_leading_one_uc.cpp.obj
[532/2522] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.issignalingl.dir/issignalingl.cpp.obj
[533/2522] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.iscanonicall.dir/iscanonicall.cpp.obj
[534/2522] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.issignalingf.dir/issignalingf.cpp.obj
[535/2522] Building CXX object libc/src/__support/CMakeFiles/libc.src.__support.freelist_heap.dir/freelist_heap.cpp.obj
[536/2522] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.iscanonicalf.dir/iscanonicalf.cpp.obj
[537/2522] Building CXX object libc/src/stdbit/CMakeFiles/libc.src.stdbit.stdc_first_trailing_zero_ull.dir/stdc_first_trailing_zero_ull.cpp.obj

@OCHyams
Copy link
Contributor Author

OCHyams commented Jul 25, 2025

LLVM Buildbot has detected a new failure on builder fuchsia-x86_64-linux running on fuchsia-debian-64-us-central1-a-1 while building llvm at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/11/builds/20364

Here is the relevant piece of the build log for the reference

FAILED: libc/src/stdio/CMakeFiles/libc.src.stdio.vsscanf.dir/vsscanf.cpp.obj 

This seems unrelated

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 25, 2025

LLVM Buildbot has detected a new failure on builder sanitizer-x86_64-linux-qemu running on sanitizer-buildbot4 while building llvm at step 2 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/139/builds/17622

Here is the relevant piece of the build log for the reference
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
[30/43] Building CXX object lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-dynamic-powerpc64le.dir/string_utils.cpp.o
[31/43] Building CXX object lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-dynamic-powerpc64le.dir/linux.cpp.o
[32/43] Building CXX object lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-dynamic-powerpc64le.dir/timing.cpp.o
[33/43] Building CXX object lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone_cxx-powerpc64le.dir/wrappers_cpp.cpp.o
[34/43] Linking CXX static library lib/linux/libclang_rt.scudo_standalone_cxx-powerpc64le.a
[35/43] cd /home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_powerpc64le_qemu/lib/scudo/standalone && /usr/bin/cmake -DCMAKE_INSTALL_COMPONENT=clang_rt.scudo_standalone_cxx-powerpc64le -P /home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_powerpc64le_qemu/cmake_install.cmake
-- Install configuration: "Release"
-- Installing: /home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/lib/clang/22/lib/linux/libclang_rt.scudo_standalone_cxx-powerpc64le.a
[36/43] Building CXX object lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-dynamic-powerpc64le.dir/wrappers_cpp.cpp.o
[37/43] Building CXX object lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-powerpc64le.dir/wrappers_c.cpp.o
FAILED: lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-powerpc64le.dir/wrappers_c.cpp.o 
/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang++ --target=powerpc64le-linux-gnu  -I/home/b/sanitizer-x86_64-linux-qemu/build/llvm-project/compiler-rt/lib/scudo/standalone/../.. -I/home/b/sanitizer-x86_64-linux-qemu/build/llvm-project/compiler-rt/lib/scudo/standalone/include -fPIC -Wall -Wno-unused-parameter -O3 -DNDEBUG -std=c++17 -fno-function-sections -fno-lto -Werror=conversion -Wall -Wextra -pedantic -g -nostdinc++ -fvisibility=hidden -fno-exceptions -Wno-pedantic -O3 -Werror=thread-safety -MD -MT lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-powerpc64le.dir/wrappers_c.cpp.o -MF lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-powerpc64le.dir/wrappers_c.cpp.o.d -o lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-powerpc64le.dir/wrappers_c.cpp.o -c /home/b/sanitizer-x86_64-linux-qemu/build/llvm-project/compiler-rt/lib/scudo/standalone/wrappers_c.cpp
clang++: /home/b/sanitizer-x86_64-linux-qemu/build/llvm-project/llvm/include/llvm/ADT/ilist_iterator.h:168: reference llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void, false, void>, false, false>::operator*() const [OptionsT = llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void, false, void>, IsReverse = false, IsConst = false]: Assertion `!NodePtr->isKnownSentinel()' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: /home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang++ --target=powerpc64le-linux-gnu -I/home/b/sanitizer-x86_64-linux-qemu/build/llvm-project/compiler-rt/lib/scudo/standalone/../.. -I/home/b/sanitizer-x86_64-linux-qemu/build/llvm-project/compiler-rt/lib/scudo/standalone/include -fPIC -Wall -Wno-unused-parameter -O3 -DNDEBUG -std=c++17 -fno-function-sections -fno-lto -Werror=conversion -Wall -Wextra -pedantic -g -nostdinc++ -fvisibility=hidden -fno-exceptions -Wno-pedantic -O3 -Werror=thread-safety -MD -MT lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-powerpc64le.dir/wrappers_c.cpp.o -MF lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-powerpc64le.dir/wrappers_c.cpp.o.d -o lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-powerpc64le.dir/wrappers_c.cpp.o -c /home/b/sanitizer-x86_64-linux-qemu/build/llvm-project/compiler-rt/lib/scudo/standalone/wrappers_c.cpp
1.	<eof> parser at end of file
2.	Code generation
3.	Running pass 'Function Pass Manager' on module '/home/b/sanitizer-x86_64-linux-qemu/build/llvm-project/compiler-rt/lib/scudo/standalone/wrappers_c.cpp'.
4.	Running pass 'Control Flow Optimizer' on function '@malloc_set_add_large_allocation_slack'
 #0 0x000063cc6947c718 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x8795718)
 #1 0x000063cc69479e35 llvm::sys::RunSignalHandlers() (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x8792e35)
 #2 0x000063cc693e19e6 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x000074cc84a45250 (/lib/x86_64-linux-gnu/libc.so.6+0x45250)
 #4 0x000074cc84aa3f1c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0xa3f1c)
 #5 0x000074cc84a4519e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4519e)
 #6 0x000074cc84a28902 abort (/lib/x86_64-linux-gnu/libc.so.6+0x28902)
 #7 0x000074cc84a2881e (/lib/x86_64-linux-gnu/libc.so.6+0x2881e)
 #8 0x000074cc84a3b7c7 (/lib/x86_64-linux-gnu/libc.so.6+0x3b7c7)
 #9 0x000063cc68716ab7 llvm::BranchFolder::HoistCommonCodeInSuccs(llvm::MachineBasicBlock*) BranchFolding.cpp:0:0
#10 0x000063cc6870eae5 llvm::BranchFolder::OptimizeFunction(llvm::MachineFunction&, llvm::TargetInstrInfo const*, llvm::TargetRegisterInfo const*, llvm::MachineLoopInfo*, bool) BranchFolding.cpp:0:0
#11 0x000063cc687184cc (anonymous namespace)::BranchFolderLegacy::runOnMachineFunction(llvm::MachineFunction&) BranchFolding.cpp:0:0
#12 0x000063cc688bdc43 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x7bd6c43)
#13 0x000063cc68e2b2a5 llvm::FPPassManager::runOnFunction(llvm::Function&) (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x81442a5)
#14 0x000063cc68e33542 llvm::FPPassManager::runOnModule(llvm::Module&) (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x814c542)
#15 0x000063cc68e2bcf6 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x8144cf6)
#16 0x000063cc69bd546f clang::emitBackendOutput(clang::CompilerInstance&, clang::CodeGenOptions&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x8eee46f)
#17 0x000063cc69be73f3 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x8f003f3)
#18 0x000063cc6b612ec9 clang::ParseAST(clang::Sema&, bool, bool) (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0xa92bec9)
#19 0x000063cc6a178d66 clang::FrontendAction::Execute() (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x9491d66)
#20 0x000063cc6a0e761d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x940061d)
#21 0x000063cc6a264f52 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x957df52)
#22 0x000063cc6695a621 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x5c73621)
#23 0x000063cc669564bf ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#24 0x000063cc69f5b489 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::$_0>(long) Job.cpp:0:0
#25 0x000063cc693e168e llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x86fa68e)
#26 0x000063cc69f5ab23 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x9273b23)
#27 0x000063cc69f1c5ec clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x92355ec)
#28 0x000063cc69f1c807 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x9235807)
Step 17 (scudo powerpc64le_qemu) failure: scudo powerpc64le_qemu (failure)
...
[30/43] Building CXX object lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-dynamic-powerpc64le.dir/string_utils.cpp.o
[31/43] Building CXX object lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-dynamic-powerpc64le.dir/linux.cpp.o
[32/43] Building CXX object lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-dynamic-powerpc64le.dir/timing.cpp.o
[33/43] Building CXX object lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone_cxx-powerpc64le.dir/wrappers_cpp.cpp.o
[34/43] Linking CXX static library lib/linux/libclang_rt.scudo_standalone_cxx-powerpc64le.a
[35/43] cd /home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_powerpc64le_qemu/lib/scudo/standalone && /usr/bin/cmake -DCMAKE_INSTALL_COMPONENT=clang_rt.scudo_standalone_cxx-powerpc64le -P /home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_powerpc64le_qemu/cmake_install.cmake
-- Install configuration: "Release"
-- Installing: /home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/lib/clang/22/lib/linux/libclang_rt.scudo_standalone_cxx-powerpc64le.a
[36/43] Building CXX object lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-dynamic-powerpc64le.dir/wrappers_cpp.cpp.o
[37/43] Building CXX object lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-powerpc64le.dir/wrappers_c.cpp.o
FAILED: lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-powerpc64le.dir/wrappers_c.cpp.o 
/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang++ --target=powerpc64le-linux-gnu  -I/home/b/sanitizer-x86_64-linux-qemu/build/llvm-project/compiler-rt/lib/scudo/standalone/../.. -I/home/b/sanitizer-x86_64-linux-qemu/build/llvm-project/compiler-rt/lib/scudo/standalone/include -fPIC -Wall -Wno-unused-parameter -O3 -DNDEBUG -std=c++17 -fno-function-sections -fno-lto -Werror=conversion -Wall -Wextra -pedantic -g -nostdinc++ -fvisibility=hidden -fno-exceptions -Wno-pedantic -O3 -Werror=thread-safety -MD -MT lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-powerpc64le.dir/wrappers_c.cpp.o -MF lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-powerpc64le.dir/wrappers_c.cpp.o.d -o lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-powerpc64le.dir/wrappers_c.cpp.o -c /home/b/sanitizer-x86_64-linux-qemu/build/llvm-project/compiler-rt/lib/scudo/standalone/wrappers_c.cpp
clang++: /home/b/sanitizer-x86_64-linux-qemu/build/llvm-project/llvm/include/llvm/ADT/ilist_iterator.h:168: reference llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void, false, void>, false, false>::operator*() const [OptionsT = llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void, false, void>, IsReverse = false, IsConst = false]: Assertion `!NodePtr->isKnownSentinel()' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: /home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang++ --target=powerpc64le-linux-gnu -I/home/b/sanitizer-x86_64-linux-qemu/build/llvm-project/compiler-rt/lib/scudo/standalone/../.. -I/home/b/sanitizer-x86_64-linux-qemu/build/llvm-project/compiler-rt/lib/scudo/standalone/include -fPIC -Wall -Wno-unused-parameter -O3 -DNDEBUG -std=c++17 -fno-function-sections -fno-lto -Werror=conversion -Wall -Wextra -pedantic -g -nostdinc++ -fvisibility=hidden -fno-exceptions -Wno-pedantic -O3 -Werror=thread-safety -MD -MT lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-powerpc64le.dir/wrappers_c.cpp.o -MF lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-powerpc64le.dir/wrappers_c.cpp.o.d -o lib/scudo/standalone/CMakeFiles/clang_rt.scudo_standalone-powerpc64le.dir/wrappers_c.cpp.o -c /home/b/sanitizer-x86_64-linux-qemu/build/llvm-project/compiler-rt/lib/scudo/standalone/wrappers_c.cpp
1.	<eof> parser at end of file
2.	Code generation
3.	Running pass 'Function Pass Manager' on module '/home/b/sanitizer-x86_64-linux-qemu/build/llvm-project/compiler-rt/lib/scudo/standalone/wrappers_c.cpp'.
4.	Running pass 'Control Flow Optimizer' on function '@malloc_set_add_large_allocation_slack'
 #0 0x000063cc6947c718 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x8795718)
 #1 0x000063cc69479e35 llvm::sys::RunSignalHandlers() (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x8792e35)
 #2 0x000063cc693e19e6 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x000074cc84a45250 (/lib/x86_64-linux-gnu/libc.so.6+0x45250)
 #4 0x000074cc84aa3f1c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0xa3f1c)
 #5 0x000074cc84a4519e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4519e)
 #6 0x000074cc84a28902 abort (/lib/x86_64-linux-gnu/libc.so.6+0x28902)
 #7 0x000074cc84a2881e (/lib/x86_64-linux-gnu/libc.so.6+0x2881e)
 #8 0x000074cc84a3b7c7 (/lib/x86_64-linux-gnu/libc.so.6+0x3b7c7)
 #9 0x000063cc68716ab7 llvm::BranchFolder::HoistCommonCodeInSuccs(llvm::MachineBasicBlock*) BranchFolding.cpp:0:0
#10 0x000063cc6870eae5 llvm::BranchFolder::OptimizeFunction(llvm::MachineFunction&, llvm::TargetInstrInfo const*, llvm::TargetRegisterInfo const*, llvm::MachineLoopInfo*, bool) BranchFolding.cpp:0:0
#11 0x000063cc687184cc (anonymous namespace)::BranchFolderLegacy::runOnMachineFunction(llvm::MachineFunction&) BranchFolding.cpp:0:0
#12 0x000063cc688bdc43 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x7bd6c43)
#13 0x000063cc68e2b2a5 llvm::FPPassManager::runOnFunction(llvm::Function&) (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x81442a5)
#14 0x000063cc68e33542 llvm::FPPassManager::runOnModule(llvm::Module&) (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x814c542)
#15 0x000063cc68e2bcf6 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x8144cf6)
#16 0x000063cc69bd546f clang::emitBackendOutput(clang::CompilerInstance&, clang::CodeGenOptions&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x8eee46f)
#17 0x000063cc69be73f3 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x8f003f3)
#18 0x000063cc6b612ec9 clang::ParseAST(clang::Sema&, bool, bool) (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0xa92bec9)
#19 0x000063cc6a178d66 clang::FrontendAction::Execute() (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x9491d66)
#20 0x000063cc6a0e761d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x940061d)
#21 0x000063cc6a264f52 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x957df52)
#22 0x000063cc6695a621 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x5c73621)
#23 0x000063cc669564bf ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#24 0x000063cc69f5b489 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::$_0>(long) Job.cpp:0:0
#25 0x000063cc693e168e llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x86fa68e)
#26 0x000063cc69f5ab23 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x9273b23)
#27 0x000063cc69f1c5ec clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x92355ec)
#28 0x000063cc69f1c807 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/home/b/sanitizer-x86_64-linux-qemu/build/llvm_build2_host/bin/clang+++0x9235807)

@OCHyams
Copy link
Contributor Author

OCHyams commented Jul 25, 2025

That's more condemning. Reverted for now #150632.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants