Skip to content
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

[SPARC] Allow overaligned allocas #107223

Merged
merged 8 commits into from
Nov 3, 2024
Merged

Conversation

koachan
Copy link
Contributor

@koachan koachan commented Sep 4, 2024

SPARC doesn't do stack realignment, so let LLVM know about it in SparcFrameLowering. This has the side effect of making all overaligned allocations go through LowerDYNAMIC_STACKALLOC, so implement the missing logic there too for overaligned allocations.
This makes the SPARC backend not crash on overaligned allocas and fix #89569.

SPARC doesn't do stack realignment, so let LLVM know about it in
`SparcFrameLowering`. This has the side effect of making all overaligned
allocations go through `LowerDYNAMIC_STACKALLOC`, so implement the missing
logic there for overaligned allocations.
This allows the SPARC backend to not crash on overaligned `alloca`s.
@llvmbot
Copy link
Member

llvmbot commented Sep 4, 2024

@llvm/pr-subscribers-compiler-rt-sanitizer

@llvm/pr-subscribers-backend-sparc

Author: Koakuma (koachan)

Changes

SPARC doesn't do stack realignment, so let LLVM know about it in SparcFrameLowering. This has the side effect of making all overaligned allocations go through LowerDYNAMIC_STACKALLOC, so implement the missing logic there too for overaligned allocations.
This makes the SPARC backend not crash on overaligned allocas and fix #89569.


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

9 Files Affected:

  • (modified) llvm/lib/Target/Sparc/SparcFrameLowering.cpp (+2-32)
  • (modified) llvm/lib/Target/Sparc/SparcISelLowering.cpp (+27-15)
  • (modified) llvm/lib/Target/Sparc/SparcRegisterInfo.cpp (-23)
  • (modified) llvm/lib/Target/Sparc/SparcRegisterInfo.h (-3)
  • (modified) llvm/test/CodeGen/Generic/ForceStackAlign.ll (-3)
  • (added) llvm/test/CodeGen/SPARC/alloca-align.ll (+113)
  • (removed) llvm/test/CodeGen/SPARC/fail-alloca-align.ll (-23)
  • (modified) llvm/test/CodeGen/SPARC/fp128.ll (+4-12)
  • (modified) llvm/test/CodeGen/SPARC/stack-align.ll (+38-15)
diff --git a/llvm/lib/Target/Sparc/SparcFrameLowering.cpp b/llvm/lib/Target/Sparc/SparcFrameLowering.cpp
index 000418be9a9e33..b28642aee4ca06 100644
--- a/llvm/lib/Target/Sparc/SparcFrameLowering.cpp
+++ b/llvm/lib/Target/Sparc/SparcFrameLowering.cpp
@@ -35,7 +35,8 @@ DisableLeafProc("disable-sparc-leaf-proc",
 SparcFrameLowering::SparcFrameLowering(const SparcSubtarget &ST)
     : TargetFrameLowering(TargetFrameLowering::StackGrowsDown,
                           ST.is64Bit() ? Align(16) : Align(8), 0,
-                          ST.is64Bit() ? Align(16) : Align(8)) {}
+                          ST.is64Bit() ? Align(16) : Align(8),
+                          /* StackRealignable */ false) {}
 
 void SparcFrameLowering::emitSPAdjustment(MachineFunction &MF,
                                           MachineBasicBlock &MBB,
@@ -97,12 +98,6 @@ void SparcFrameLowering::emitPrologue(MachineFunction &MF,
   // Debug location must be unknown since the first debug location is used
   // to determine the end of the prologue.
   DebugLoc dl;
-  bool NeedsStackRealignment = RegInfo.shouldRealignStack(MF);
-
-  if (NeedsStackRealignment && !RegInfo.canRealignStack(MF))
-    report_fatal_error("Function \"" + Twine(MF.getName()) + "\" required "
-                       "stack re-alignment, but LLVM couldn't handle it "
-                       "(probably because it has a dynamic alloca).");
 
   // Get the number of bytes to allocate from the FrameInfo
   int NumBytes = (int) MFI.getStackSize();
@@ -168,31 +163,6 @@ void SparcFrameLowering::emitPrologue(MachineFunction &MF,
       MCCFIInstruction::createRegister(nullptr, regOutRA, regInRA));
   BuildMI(MBB, MBBI, dl, TII.get(TargetOpcode::CFI_INSTRUCTION))
       .addCFIIndex(CFIIndex);
-
-  if (NeedsStackRealignment) {
-    int64_t Bias = Subtarget.getStackPointerBias();
-    unsigned regUnbiased;
-    if (Bias) {
-      // This clobbers G1 which we always know is available here.
-      regUnbiased = SP::G1;
-      // add %o6, BIAS, %g1
-      BuildMI(MBB, MBBI, dl, TII.get(SP::ADDri), regUnbiased)
-        .addReg(SP::O6).addImm(Bias);
-    } else
-      regUnbiased = SP::O6;
-
-    // andn %regUnbiased, MaxAlign-1, %regUnbiased
-    Align MaxAlign = MFI.getMaxAlign();
-    BuildMI(MBB, MBBI, dl, TII.get(SP::ANDNri), regUnbiased)
-        .addReg(regUnbiased)
-        .addImm(MaxAlign.value() - 1U);
-
-    if (Bias) {
-      // add %g1, -BIAS, %o6
-      BuildMI(MBB, MBBI, dl, TII.get(SP::ADDri), SP::O6)
-        .addReg(regUnbiased).addImm(-Bias);
-    }
-  }
 }
 
 MachineBasicBlock::iterator SparcFrameLowering::
diff --git a/llvm/lib/Target/Sparc/SparcISelLowering.cpp b/llvm/lib/Target/Sparc/SparcISelLowering.cpp
index 42b8248006d1fd..06bd2aa27e904f 100644
--- a/llvm/lib/Target/Sparc/SparcISelLowering.cpp
+++ b/llvm/lib/Target/Sparc/SparcISelLowering.cpp
@@ -2764,20 +2764,27 @@ static SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG,
                                        const SparcSubtarget *Subtarget) {
   SDValue Chain = Op.getOperand(0);  // Legalize the chain.
   SDValue Size  = Op.getOperand(1);  // Legalize the size.
-  MaybeAlign Alignment =
-      cast<ConstantSDNode>(Op.getOperand(2))->getMaybeAlignValue();
+  SDValue Alignment = Op.getOperand(2); // Legalize the alignment.
+  MaybeAlign MaybeAlignment =
+      cast<ConstantSDNode>(Alignment)->getMaybeAlignValue();
   Align StackAlign = Subtarget->getFrameLowering()->getStackAlign();
   EVT VT = Size->getValueType(0);
   SDLoc dl(Op);
 
-  // TODO: implement over-aligned alloca. (Note: also implies
-  // supporting support for overaligned function frames + dynamic
-  // allocations, at all, which currently isn't supported)
-  if (Alignment && *Alignment > StackAlign) {
-    const MachineFunction &MF = DAG.getMachineFunction();
-    report_fatal_error("Function \"" + Twine(MF.getName()) + "\": "
-                       "over-aligned dynamic alloca not supported.");
-  }
+  int64_t Bias = Subtarget->getStackPointerBias();
+  unsigned SPReg = SP::O6;
+  SDValue SP = DAG.getCopyFromReg(Chain, dl, SPReg, VT);
+  SDValue AlignedPtr = SP;
+
+  bool IsOveraligned = MaybeAlignment && *MaybeAlignment > StackAlign;
+  if (IsOveraligned)
+    AlignedPtr = DAG.getNode(
+        ISD::AND, dl, VT,
+        DAG.getNode(
+            ISD::SUB, dl, VT,
+            DAG.getNode(ISD::ADD, dl, VT, SP, DAG.getConstant(Bias, dl, VT)),
+            Alignment),
+        DAG.getNode(ISD::SUB, dl, VT, DAG.getConstant(0, dl, VT), Alignment));
 
   // The resultant pointer needs to be above the register spill area
   // at the bottom of the stack.
@@ -2811,12 +2818,17 @@ static SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG,
     regSpillArea = 96;
   }
 
-  unsigned SPReg = SP::O6;
-  SDValue SP = DAG.getCopyFromReg(Chain, dl, SPReg, VT);
-  SDValue NewSP = DAG.getNode(ISD::SUB, dl, VT, SP, Size); // Value
-  Chain = DAG.getCopyToReg(SP.getValue(1), dl, SPReg, NewSP);    // Output chain
+  AlignedPtr = DAG.getNode(ISD::SUB, dl, VT, AlignedPtr, Size);
 
-  regSpillArea += Subtarget->getStackPointerBias();
+  // If we are allocating overaligned memory then the bias is already accounted
+  // for in AlignedPtr calculation, so:
+  // - We do not need to adjust the regSpillArea; but
+  // - We do need to decrement AlignedPtr by bias to obtain the new SP.
+  regSpillArea += IsOveraligned ? 0 : Bias;
+  SDValue NewSP =
+      DAG.getNode(ISD::SUB, dl, VT, AlignedPtr,
+                  DAG.getConstant(IsOveraligned ? Bias : 0, dl, VT));
+  Chain = DAG.getCopyToReg(SP.getValue(1), dl, SPReg, NewSP);
 
   SDValue NewVal = DAG.getNode(ISD::ADD, dl, VT, NewSP,
                                DAG.getConstant(regSpillArea, dl, VT));
diff --git a/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp b/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp
index 71a27f77d2c6bf..e4db27a63076d8 100644
--- a/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp
+++ b/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp
@@ -226,26 +226,3 @@ SparcRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
 Register SparcRegisterInfo::getFrameRegister(const MachineFunction &MF) const {
   return SP::I6;
 }
-
-// Sparc has no architectural need for stack realignment support,
-// except that LLVM unfortunately currently implements overaligned
-// stack objects by depending upon stack realignment support.
-// If that ever changes, this can probably be deleted.
-bool SparcRegisterInfo::canRealignStack(const MachineFunction &MF) const {
-  if (!TargetRegisterInfo::canRealignStack(MF))
-    return false;
-
-  // Sparc always has a fixed frame pointer register, so don't need to
-  // worry about needing to reserve it. [even if we don't have a frame
-  // pointer for our frame, it still cannot be used for other things,
-  // or register window traps will be SADNESS.]
-
-  // If there's a reserved call frame, we can use SP to access locals.
-  if (getFrameLowering(MF)->hasReservedCallFrame(MF))
-    return true;
-
-  // Otherwise, we'd need a base pointer, but those aren't implemented
-  // for SPARC at the moment.
-
-  return false;
-}
diff --git a/llvm/lib/Target/Sparc/SparcRegisterInfo.h b/llvm/lib/Target/Sparc/SparcRegisterInfo.h
index 58c85f33635f2d..eae859ce1a519e 100644
--- a/llvm/lib/Target/Sparc/SparcRegisterInfo.h
+++ b/llvm/lib/Target/Sparc/SparcRegisterInfo.h
@@ -40,9 +40,6 @@ struct SparcRegisterInfo : public SparcGenRegisterInfo {
                            RegScavenger *RS = nullptr) const override;
 
   Register getFrameRegister(const MachineFunction &MF) const override;
-
-  bool canRealignStack(const MachineFunction &MF) const override;
-
 };
 
 } // end namespace llvm
diff --git a/llvm/test/CodeGen/Generic/ForceStackAlign.ll b/llvm/test/CodeGen/Generic/ForceStackAlign.ll
index 7993b3eff65b68..811a192e752ab1 100644
--- a/llvm/test/CodeGen/Generic/ForceStackAlign.ll
+++ b/llvm/test/CodeGen/Generic/ForceStackAlign.ll
@@ -5,9 +5,6 @@
 ; CHECK-LABEL: @f
 ; CHECK-LABEL: @g
 
-; Stack realignment not supported.
-; XFAIL: target=sparc{{.*}}
-
 ; NVPTX can only select dynamic_stackalloc on sm_52+ and with ptx73+
 ; XFAIL: target=nvptx{{.*}}
 
diff --git a/llvm/test/CodeGen/SPARC/alloca-align.ll b/llvm/test/CodeGen/SPARC/alloca-align.ll
new file mode 100644
index 00000000000000..1ece601437ea4a
--- /dev/null
+++ b/llvm/test/CodeGen/SPARC/alloca-align.ll
@@ -0,0 +1,113 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
+; RUN: llc -march=sparc < %s | FileCheck %s --check-prefixes=CHECK32
+; RUN: llc -march=sparcv9 < %s | FileCheck %s --check-prefixes=CHECK64
+
+define void @variable_alloca_with_overalignment(i32 %num) {
+; CHECK32-LABEL: variable_alloca_with_overalignment:
+; CHECK32:         .cfi_startproc
+; CHECK32-NEXT:  ! %bb.0:
+; CHECK32-NEXT:    save %sp, -96, %sp
+; CHECK32-NEXT:    .cfi_def_cfa_register %fp
+; CHECK32-NEXT:    .cfi_window_save
+; CHECK32-NEXT:    .cfi_register %o7, %i7
+; CHECK32-NEXT:    add %sp, -64, %i1
+; CHECK32-NEXT:    and %i1, -64, %i1
+; CHECK32-NEXT:    add %i1, -16, %sp
+; CHECK32-NEXT:    add %i0, 7, %i0
+; CHECK32-NEXT:    and %i0, -8, %i0
+; CHECK32-NEXT:    sub %sp, %i0, %i0
+; CHECK32-NEXT:    add %i1, 80, %o0
+; CHECK32-NEXT:    add %i0, -8, %sp
+; CHECK32-NEXT:    call foo
+; CHECK32-NEXT:    add %i0, 88, %o1
+; CHECK32-NEXT:    ret
+; CHECK32-NEXT:    restore
+;
+; CHECK64-LABEL: variable_alloca_with_overalignment:
+; CHECK64:         .cfi_startproc
+; CHECK64-NEXT:  ! %bb.0:
+; CHECK64-NEXT:    save %sp, -128, %sp
+; CHECK64-NEXT:    .cfi_def_cfa_register %fp
+; CHECK64-NEXT:    .cfi_window_save
+; CHECK64-NEXT:    .cfi_register %o7, %i7
+; CHECK64-NEXT:    add %sp, 1983, %i1
+; CHECK64-NEXT:    and %i1, -64, %i1
+; CHECK64-NEXT:    add %i1, -2063, %sp
+; CHECK64-NEXT:    add %i1, -1935, %o0
+; CHECK64-NEXT:    srl %i0, 0, %i0
+; CHECK64-NEXT:    add %i0, 15, %i0
+; CHECK64-NEXT:    sethi 4194303, %i1
+; CHECK64-NEXT:    or %i1, 1008, %i1
+; CHECK64-NEXT:    sethi 0, %i2
+; CHECK64-NEXT:    or %i2, 1, %i2
+; CHECK64-NEXT:    sllx %i2, 32, %i2
+; CHECK64-NEXT:    or %i2, %i1, %i1
+; CHECK64-NEXT:    and %i0, %i1, %i0
+; CHECK64-NEXT:    sub %sp, %i0, %i0
+; CHECK64-NEXT:    add %i0, 2175, %o1
+; CHECK64-NEXT:    mov %i0, %sp
+; CHECK64-NEXT:    call foo
+; CHECK64-NEXT:    add %sp, -48, %sp
+; CHECK64-NEXT:    add %sp, 48, %sp
+; CHECK64-NEXT:    ret
+; CHECK64-NEXT:    restore
+  %aligned = alloca i32, align 64
+  %var_size = alloca i8, i32 %num, align 4
+  call void @foo(ptr %aligned, ptr %var_size)
+  ret void
+}
+
+;; Same but with the alloca itself overaligned
+define void @variable_alloca_with_overalignment_2(i32 %num) {
+; CHECK32-LABEL: variable_alloca_with_overalignment_2:
+; CHECK32:         .cfi_startproc
+; CHECK32-NEXT:  ! %bb.0:
+; CHECK32-NEXT:    save %sp, -96, %sp
+; CHECK32-NEXT:    .cfi_def_cfa_register %fp
+; CHECK32-NEXT:    .cfi_window_save
+; CHECK32-NEXT:    .cfi_register %o7, %i7
+; CHECK32-NEXT:    add %i0, 7, %i0
+; CHECK32-NEXT:    and %i0, -8, %i0
+; CHECK32-NEXT:    add %sp, -64, %i1
+; CHECK32-NEXT:    and %i1, -64, %i1
+; CHECK32-NEXT:    sub %i1, %i0, %i0
+; CHECK32-NEXT:    add %i0, -8, %sp
+; CHECK32-NEXT:    add %i0, 88, %o1
+; CHECK32-NEXT:    call foo
+; CHECK32-NEXT:    mov %g0, %o0
+; CHECK32-NEXT:    ret
+; CHECK32-NEXT:    restore
+;
+; CHECK64-LABEL: variable_alloca_with_overalignment_2:
+; CHECK64:         .cfi_startproc
+; CHECK64-NEXT:  ! %bb.0:
+; CHECK64-NEXT:    save %sp, -128, %sp
+; CHECK64-NEXT:    .cfi_def_cfa_register %fp
+; CHECK64-NEXT:    .cfi_window_save
+; CHECK64-NEXT:    .cfi_register %o7, %i7
+; CHECK64-NEXT:    srl %i0, 0, %i0
+; CHECK64-NEXT:    add %i0, 15, %i0
+; CHECK64-NEXT:    sethi 4194303, %i1
+; CHECK64-NEXT:    or %i1, 1008, %i1
+; CHECK64-NEXT:    sethi 0, %i2
+; CHECK64-NEXT:    or %i2, 1, %i2
+; CHECK64-NEXT:    sllx %i2, 32, %i2
+; CHECK64-NEXT:    or %i2, %i1, %i1
+; CHECK64-NEXT:    and %i0, %i1, %i0
+; CHECK64-NEXT:    add %sp, 1983, %i1
+; CHECK64-NEXT:    and %i1, -64, %i1
+; CHECK64-NEXT:    sub %i1, %i0, %i0
+; CHECK64-NEXT:    add %i0, -2047, %sp
+; CHECK64-NEXT:    add %i0, -1919, %o1
+; CHECK64-NEXT:    add %sp, -48, %sp
+; CHECK64-NEXT:    call foo
+; CHECK64-NEXT:    mov %g0, %o0
+; CHECK64-NEXT:    add %sp, 48, %sp
+; CHECK64-NEXT:    ret
+; CHECK64-NEXT:    restore
+  %var_size = alloca i8, i32 %num, align 64
+  call void @foo(ptr null, ptr %var_size)
+  ret void
+}
+
+declare void @foo(ptr, ptr);
diff --git a/llvm/test/CodeGen/SPARC/fail-alloca-align.ll b/llvm/test/CodeGen/SPARC/fail-alloca-align.ll
deleted file mode 100644
index e2dc235389b1dc..00000000000000
--- a/llvm/test/CodeGen/SPARC/fail-alloca-align.ll
+++ /dev/null
@@ -1,23 +0,0 @@
-;; Sparc backend can't currently handle variable allocas with
-;; alignment greater than the stack alignment.  This code ought to
-;; compile, but doesn't currently.
-
-;; RUN: not --crash llc -march=sparc < %s 2>&1 | FileCheck %s
-;; RUN: not --crash llc -march=sparcv9 < %s 2>&1 | FileCheck %s
-;; CHECK: ERROR: Function {{.*}} required stack re-alignment
-
-define void @variable_alloca_with_overalignment(i32 %num) {
-  %aligned = alloca i32, align 64
-  %var_size = alloca i8, i32 %num, align 4
-  call void @foo(ptr %aligned, ptr %var_size)
-  ret void
-}
-
-;; Same but with the alloca itself overaligned
-define void @variable_alloca_with_overalignment_2(i32 %num) {
-  %var_size = alloca i8, i32 %num, align 64
-  call void @foo(ptr null, ptr %var_size)
-  ret void
-}
-
-declare void @foo(ptr, ptr);
diff --git a/llvm/test/CodeGen/SPARC/fp128.ll b/llvm/test/CodeGen/SPARC/fp128.ll
index 80f3da285e053f..3e43d3eb5da70f 100644
--- a/llvm/test/CodeGen/SPARC/fp128.ll
+++ b/llvm/test/CodeGen/SPARC/fp128.ll
@@ -54,18 +54,10 @@ entry:
 
 ; CHECK-LABEL: f128_spill_large:
 ; CHECK:       sethi 4, %g1
-; CHECK:       sethi 4, %g1
-; CHECK-NEXT:  add %g1, %sp, %g1
-; CHECK-NEXT:  std %f{{.+}}, [%g1]
-; CHECK:       sethi 4, %g1
-; CHECK-NEXT:  add %g1, %sp, %g1
-; CHECK-NEXT:  std %f{{.+}}, [%g1+8]
-; CHECK:       sethi 4, %g1
-; CHECK-NEXT:  add %g1, %sp, %g1
-; CHECK-NEXT:  ldd [%g1], %f{{.+}}
-; CHECK:       sethi 4, %g1
-; CHECK-NEXT:  add %g1, %sp, %g1
-; CHECK-NEXT:  ldd [%g1+8], %f{{.+}}
+; CHECK:       std %f{{.+}}, [%fp+-16]
+; CHECK-NEXT:  std %f{{.+}}, [%fp+-8]
+; CHECK:       ldd [%fp+-16], %f{{.+}}
+; CHECK-NEXT:  ldd [%fp+-8], %f{{.+}}
 
 define void @f128_spill_large(ptr noalias sret(<251 x fp128>) %scalar.result, ptr byval(<251 x fp128>) %a) {
 entry:
diff --git a/llvm/test/CodeGen/SPARC/stack-align.ll b/llvm/test/CodeGen/SPARC/stack-align.ll
index 6632237f08e274..e2dfe854d643a1 100644
--- a/llvm/test/CodeGen/SPARC/stack-align.ll
+++ b/llvm/test/CodeGen/SPARC/stack-align.ll
@@ -1,24 +1,47 @@
-; RUN: llc -march=sparc < %s | FileCheck %s --check-prefixes=CHECK,CHECK32
-; RUN: llc -march=sparcv9 < %s | FileCheck %s --check-prefixes=CHECK,CHECK64
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
+; RUN: llc -march=sparc < %s | FileCheck %s --check-prefixes=CHECK32
+; RUN: llc -march=sparcv9 < %s | FileCheck %s --check-prefixes=CHECK64
 declare void @stack_realign_helper(i32 %a, ptr %b)
 
 ;; This is a function where we have a local variable of 64-byte
-;; alignment.  We want to see that the stack is aligned (the initial
-;; andn), that the local var is accessed via stack pointer (to %o1), and that
+;; alignment.  We want to see that the stack is aligned (the initial add/and),
+;; that the local var is accessed via stack pointer (to %o1), and that
 ;; the argument is accessed via frame pointer not stack pointer (to %o0).
 
-;; CHECK-LABEL: stack_realign:
-;; CHECK32:      andn %sp, 63, %sp
-;; CHECK32-NEXT: ld [%fp+92], %o0
-;; CHECK64:      add %sp, 2047, %g1
-;; CHECK64-NEXT: andn %g1, 63, %g1
-;; CHECK64-NEXT: add %g1, -2047, %sp
-;; CHECK64-NEXT: ld [%fp+2227], %o0
-;; CHECK-NEXT:   call stack_realign_helper
-;; CHECK32-NEXT: add %sp, 128, %o1
-;; CHECK64-NEXT: add %sp, 2239, %o1
-
 define void @stack_realign(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e, i32 %f, i32 %g) {
+; CHECK32-LABEL: stack_realign:
+; CHECK32:         .cfi_startproc
+; CHECK32-NEXT:  ! %bb.0: ! %entry
+; CHECK32-NEXT:    save %sp, -96, %sp
+; CHECK32-NEXT:    .cfi_def_cfa_register %fp
+; CHECK32-NEXT:    .cfi_window_save
+; CHECK32-NEXT:    .cfi_register %o7, %i7
+; CHECK32-NEXT:    ld [%fp+92], %o0
+; CHECK32-NEXT:    add %sp, -64, %i0
+; CHECK32-NEXT:    and %i0, -64, %i0
+; CHECK32-NEXT:    add %i0, -16, %sp
+; CHECK32-NEXT:    call stack_realign_helper
+; CHECK32-NEXT:    add %i0, 80, %o1
+; CHECK32-NEXT:    ret
+; CHECK32-NEXT:    restore
+;
+; CHECK64-LABEL: stack_realign:
+; CHECK64:         .cfi_startproc
+; CHECK64-NEXT:  ! %bb.0: ! %entry
+; CHECK64-NEXT:    save %sp, -128, %sp
+; CHECK64-NEXT:    .cfi_def_cfa_register %fp
+; CHECK64-NEXT:    .cfi_window_save
+; CHECK64-NEXT:    .cfi_register %o7, %i7
+; CHECK64-NEXT:    add %sp, 1983, %i0
+; CHECK64-NEXT:    and %i0, -64, %i0
+; CHECK64-NEXT:    add %i0, -2063, %sp
+; CHECK64-NEXT:    add %i0, -1935, %o1
+; CHECK64-NEXT:    add %sp, -48, %sp
+; CHECK64-NEXT:    call stack_realign_helper
+; CHECK64-NEXT:    ld [%fp+2227], %o0
+; CHECK64-NEXT:    add %sp, 48, %sp
+; CHECK64-NEXT:    ret
+; CHECK64-NEXT:    restore
 entry:
   %aligned = alloca i32, align 64
   call void @stack_realign_helper(i32 %g, ptr %aligned)

@koachan
Copy link
Contributor Author

koachan commented Sep 4, 2024

Tagging this as WIP since I feel like the calculation could be done better.
Also, I am not very confident yet with the codegen result in fp128.ll.

@koachan
Copy link
Contributor Author

koachan commented Sep 4, 2024

Also, @cpython-java, can you please try this patch too? ^_^

SDValue SP = DAG.getCopyFromReg(Chain, dl, SPReg, VT);
SDValue AlignedPtr = SP;

bool IsOveraligned = MaybeAlignment && *MaybeAlignment > StackAlign;
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no need for the second check.
Alignment, if present, is guaranteed to be greater than the stack alignment.

llvm/lib/Target/Sparc/SparcFrameLowering.cpp Outdated Show resolved Hide resolved
llvm/lib/Target/Sparc/SparcISelLowering.cpp Outdated Show resolved Hide resolved
SDValue SP = DAG.getCopyFromReg(Chain, dl, SPReg, VT);
SDValue NewSP = DAG.getNode(ISD::SUB, dl, VT, SP, Size); // Value
Chain = DAG.getCopyToReg(SP.getValue(1), dl, SPReg, NewSP); // Output chain
AlignedPtr = DAG.getNode(ISD::SUB, dl, VT, AlignedPtr, Size);
Copy link
Contributor

@s-barannikov s-barannikov Sep 4, 2024

Choose a reason for hiding this comment

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

The subtraction should be done before aligning to avoid excessive stack usage.
Take for example
old sp = 40, size = 8, align = 16
The current formula gives:
new sp = (40 - 16) & -16 - 8 = 8
That is, it allocates 32 bytes instead of just 8 (which would be sufficient because 40 - 8 = 32 is 16-byte aligned).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A little question here: why is the aligning formula (ptr - align) & -align instead of just ptr & -align?
In my understanding the latter should avoid excessive allocation too; using your example of old sp = 40, size = 8, align = 16:

ptr = 40 - 8 // 32

// using (ptr - align) & -align
new sp = (32 - 16) & (-16) // 16, overallocating by 16 bytes

// using ptr & -align
new sp = 32 & -16 // 32

Copy link
Contributor

Choose a reason for hiding this comment

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

It should be (ptr - size) & -align.

llvm/test/CodeGen/SPARC/alloca-align.ll Outdated Show resolved Hide resolved
@rorth
Copy link
Collaborator

rorth commented Sep 4, 2024

I'm currently building with this patch on Solaris/sparcv9, initially as is. Later I'm going to enable ASan on 32-bit SPARC to see how this goes (Issue #57626).

@rorth
Copy link
Collaborator

rorth commented Sep 5, 2024

I've made some progess on the 32-bit Solaris/sparc side:

Failed Tests (36):
  AddressSanitizer-Unit :: ./Asan-sparc-calls-Dynamic-Test/65/93
  AddressSanitizer-Unit :: ./Asan-sparc-calls-Test/65/93
  AddressSanitizer-Unit :: ./Asan-sparc-inline-Dynamic-Test/65/93
  AddressSanitizer-Unit :: ./Asan-sparc-inline-Test/65/93
  AddressSanitizer-sparc-sunos :: TestCases/Posix/stack-overflow.cpp
  AddressSanitizer-sparc-sunos :: TestCases/alloca_big_alignment.cpp
  AddressSanitizer-sparc-sunos :: TestCases/alloca_detect_custom_size_.cpp
  AddressSanitizer-sparc-sunos :: TestCases/alloca_loop_unpoisoning.cpp
  AddressSanitizer-sparc-sunos :: TestCases/alloca_overflow_partial.cpp
  AddressSanitizer-sparc-sunos :: TestCases/alloca_overflow_right.cpp
  AddressSanitizer-sparc-sunos :: TestCases/alloca_safe_access.cpp
  AddressSanitizer-sparc-sunos :: TestCases/alloca_underflow_left.cpp
  AddressSanitizer-sparc-sunos :: TestCases/alloca_vla_interact.cpp
  AddressSanitizer-sparc-sunos :: TestCases/global-overflow.cpp
  AddressSanitizer-sparc-sunos :: TestCases/large_func_test.cpp
  AddressSanitizer-sparc-sunos :: TestCases/vla_chrome_testcase.cpp
  AddressSanitizer-sparc-sunos :: TestCases/vla_condition_overflow.cpp
  AddressSanitizer-sparc-sunos :: TestCases/vla_loop_overfow.cpp
  AddressSanitizer-sparc-sunos :: TestCases/zero_page_pc.cpp
  AddressSanitizer-sparc-sunos-dynamic :: TestCases/Posix/stack-overflow.cpp
  AddressSanitizer-sparc-sunos-dynamic :: TestCases/alloca_big_alignment.cpp
  AddressSanitizer-sparc-sunos-dynamic :: TestCases/alloca_detect_custom_size_.cpp
  AddressSanitizer-sparc-sunos-dynamic :: TestCases/alloca_loop_unpoisoning.cpp
  AddressSanitizer-sparc-sunos-dynamic :: TestCases/alloca_overflow_partial.cpp
  AddressSanitizer-sparc-sunos-dynamic :: TestCases/alloca_overflow_right.cpp
  AddressSanitizer-sparc-sunos-dynamic :: TestCases/alloca_safe_access.cpp
  AddressSanitizer-sparc-sunos-dynamic :: TestCases/alloca_underflow_left.cpp
  AddressSanitizer-sparc-sunos-dynamic :: TestCases/alloca_vla_interact.cpp
  AddressSanitizer-sparc-sunos-dynamic :: TestCases/global-overflow.cpp
  AddressSanitizer-sparc-sunos-dynamic :: TestCases/large_func_test.cpp
  AddressSanitizer-sparc-sunos-dynamic :: TestCases/vla_chrome_testcase.cpp
  AddressSanitizer-sparc-sunos-dynamic :: TestCases/vla_condition_overflow.cpp
  AddressSanitizer-sparc-sunos-dynamic :: TestCases/vla_loop_overfow.cpp
  AddressSanitizer-sparc-sunos-dynamic :: TestCases/zero_page_pc.cpp
  SanitizerCommon-asan-sparc-SunOS :: sanitizer_coverage_trace_pc_guard-dso.cpp
  SanitizerCommon-asan-sparc-SunOS :: sanitizer_coverage_trace_pc_guard.cpp

Some of the failures are generic issues with the testcases (e.g. performing unaligned accesses on a strict-alignment target), others might be an endianess issue, but a considerable part of the failures may be related to an issue with your patch, e.g.
AddressSanitizer-sparc-sunos :: TestCases/alloca_big_alignment.cpp which, like quite a number of others, FAILs like

Assertion failed: !(reinterpret_cast<uintptr_t>(str) & 127L), file /vol/llvm/src/llvm-project/local/compiler-rt/test/asan/TestCases/alloca_big_alignment.cpp, line 10

ISTM that your patch doesn't yet heed __attribute__((aligned(128))).

The Linux/sparc64 side of things is considerably worse, unfortunately: quite a number of ASan tests just hang, and while the unittests do work, several 64-bit tests SEGV. Getting this to work will probably take quite a debugging effort. I guess I'll concentrate on the Solaris side, at least initially.

rorth added a commit to rorth/llvm-project that referenced this pull request Sep 5, 2024
With PR llvm#107223 and PR llvm#107403, ASan testing can be enabled on SPARC.  This
patch does so, 32-bit only on Solaris (there is no 64-bit support even in
GCC), and both 32 and 64-bit on Linux (although GCC only support 32-bit
here).

Apart from the obvious CMake changes, this patch includes a couple of
testcase adjustments necessary for SPARC:
- In `asan_oob_test.cpp`, the `OOB_int` subtest needs to be disabled: it
  performs unaligned accesses that cannot work on a strict-alignment target
  like SPARC.
- `asan_test.cpp` needs to disable subtests that depend on support for
  `__builtin_setjmp` and `__builtin_longjmp`.
- `zero_page_pc.cpp` reports `0x5` as the faulting address on access to
  `0x4`.  I don't really know why, but it's consistent between Solaris and
  Linux.

Tested on `sparcv9-sun-solaris2.11` and `sparc64-unknown-linux-gnu`.

Solaris results are not too bad (36 `FAIL`s) while the Linux ones are quite
bad, in particular because quite a number of tests just hang.

For those reasons, I'm just posting the patch for reference in case someone
else wants to try this on Linux.
@rorth
Copy link
Collaborator

rorth commented Sep 5, 2024

Just for reference, I've posted the patches I've used for my ASan testing: PR #107403 for the driver side and PR #107405 for enabling the ASan tests in compiler-rt.

Upon calculating NewSP we end up with a biased SP again, so we
need to account for that in NewVal return.
@koachan
Copy link
Contributor Author

koachan commented Sep 12, 2024

Just for reference, I've posted the patches I've used for my ASan testing: PR #107403 for the driver side and PR #107405 for enabling the ASan tests in compiler-rt.

Are these patches for Solaris only or do they apply for Linux too?
I'd like to try the asan tests too, but after applying them on my Linux box it seems like check-asan is still not available:

$ ninja check-asan
ninja: error: unknown target 'check-asan', did you mean 'check-all'?

@rorth
Copy link
Collaborator

rorth commented Sep 12, 2024

Just for reference, I've posted the patches I've used for my ASan testing: PR #107403 for the driver side and PR #107405 for enabling the ASan tests in compiler-rt.

Are these patches for Solaris only or do they apply for Linux too? I'd like to try the asan tests too, but after applying them on my Linux box it seems like check-asan is still not available:

$ ninja check-asan
ninja: error: unknown target 'check-asan', did you mean 'check-all'?

The patches work on Linux/sparc64, too. You don't need the driver one (clang on Linux always assumes ASan is supported). I'd revised the compiler-rt test one last night when I managed to avoid hangs in many ASan tests on Linux. Besides, I've removed sparcv9 again: while there is some support for that in compiler-rt, neither clang nor gcc have anything matching, so there were hundreds of sparcv9 ASan failures. I'm currently finishing one that avoids failures on tests involving stack overflows (works on Solaris already, needs some tweeks for Linux) and posted two testsuite adjustments for ASan on SPARC in general (PRs #108206 and #108200). There's also one to disable InstallAtForkHandler on Linux/sparc64, but that may well be a hack rather than a fix.

I guess it's best if you give me a day or two to finish this stuff.

Thanks a lot for your work, which finally will allow clang ASan support to be on par with gcc.

@rorth
Copy link
Collaborator

rorth commented Sep 13, 2024

Most patches should be in place now. On Solaris/sparcv9, there are only two failures left:

  AddressSanitizer-sparc-sunos :: TestCases/alloca_big_alignment.cpp

Assertion failed: !(reinterpret_cast<uintptr_t>(str) & 127L), file compiler-rt/test/asan/TestCases/alloca_big_alignment.cpp, line 10

  AddressSanitizer-sparc-sunos :: TestCases/alloca_vla_interact.cpp

Assertion failed: q == top, file compiler-rt/test/asan/TestCases/alloca_vla_interact.cpp, line 45

The necessary patches are PRs #107405, #108206, #108200, and #108542.

There's one patch left that's in final testing: tests like AddressSanitizer-sparc-sunos :: TestCases/Posix/stack-overflow.cpp that involve stack overflows currently incur a second SEGV when trying to read the frame pointer from the (now invalid) stack. The patch to avoid that is working on Solaris. It requires a V9 insn which can only be used with -mcpu=v9 on Linux/sparc64. That isn't the default however, and a patch to enable it has been stalled for 2 years now. I'm currently trying to finish it.

There are several more failures on Linux/sparc64, some of which involve (lack of) printf interception as reported in Issue #108392, while a few others require further analysis.

@rorth
Copy link
Collaborator

rorth commented Sep 16, 2024

Your last change brought the Solaris/sparcv9 failures down to just one:

  AddressSanitizer-sparc-sunos :: TestCases/alloca_vla_interact.cpp
  AddressSanitizer-sparc-sunos-dynamic :: TestCases/alloca_vla_interact.cpp

same as reported before:

Assertion failed: q == top, file /vol/llvm/src/llvm-project/local/compiler-rt/test/asan/TestCases/alloca_vla_interact.cpp, line 45

Linux/sparc64 is worse, but AFAICS none of the failures there are related to this patch, just Linux/sparc64 specific issues.

Thanks again!

@koachan
Copy link
Contributor Author

koachan commented Sep 23, 2024

Assertion failed: q == top, file /vol/llvm/src/llvm-project/local/compiler-rt/test/asan/TestCases/alloca_vla_interact.cpp, line 45

Linux/sparc64 is worse, but AFAICS none of the failures there are related to this patch, just Linux/sparc64 specific issues.

Thanks again!

I admit I still find it hard to understand what is this testing, so may I ask for some explaination?
I'm not very familiar with the constructs used there, and, particularly, the asan functions...

@rorth
Copy link
Collaborator

rorth commented Sep 23, 2024

I admit I still find it hard to understand what is this testing, so may I ask for some explaination? I'm not very familiar with the constructs used there, and, particularly, the asan functions...

Neither am I. I guess it's best to ask the author of the testcase, originally submitted in Implement variable-sized alloca instrumentation (take 2).. However, I cannot find a github account for him (m.ostapenko). Maybe @yugr or @vitalybuka can shed some light?

FWIW, I've tried to build the testcase with gcc (which supports 32-bit ASan on SPARC just fine), but the test fails there, too.

@yugr
Copy link
Member

yugr commented Sep 23, 2024

However, I cannot find a github account for him (m.ostapenko).

@chefmax7

rorth added a commit that referenced this pull request Sep 25, 2024
Once PR #107223 lands, ASan can be enabled on Solaris/SPARC. This patch
does just that. As on Solaris/x86, the dynamic ASan runtime lib needs to
be linked with `-z now` to avoid an `AsanInitInternal` cycle.

Tested on `sparcv9-sun-solaris2.11` and `sparc64-unknown-linux-gnu`.
augusto2112 pushed a commit to augusto2112/llvm-project that referenced this pull request Sep 26, 2024
Once PR llvm#107223 lands, ASan can be enabled on Solaris/SPARC. This patch
does just that. As on Solaris/x86, the dynamic ASan runtime lib needs to
be linked with `-z now` to avoid an `AsanInitInternal` cycle.

Tested on `sparcv9-sun-solaris2.11` and `sparc64-unknown-linux-gnu`.
@koachan koachan changed the title [WIP][SPARC] Allow overaligned allocas [SPARC] Allow overaligned allocas Sep 30, 2024
@koachan
Copy link
Contributor Author

koachan commented Sep 30, 2024

Taking out the WIP status since I think this is ready for merging now.
(Aside from the one asan failure case - but if GCC also fails there that means that at least we're on par with it, no?)

@rorth
Copy link
Collaborator

rorth commented Sep 30, 2024

Taking out the WIP status since I think this is ready for merging now. (Aside from the one asan failure case - but if GCC also fails there that means that at least we're on par with it, no?)

I've just retried the testcase on Linux/i386 with gcc-14, where it FAILs as well. It may well depend on -mllvm -asan-instrument-dynamic-allocas which gcc obviously doesn't support.

That said, I'm fine with merging the patch now, with one caveat: please first file an Issue for the remaining failure with everything that's known about the issue, then XFAIL the testcase on SPARC to avoid the Solaris/sparcv9 bot turning red immediately (oh wait, it already is due to PR #106951 ;-().

@chefmax7
Copy link
Contributor

chefmax7 commented Oct 2, 2024

Assertion failed: q == top, file /vol/llvm/src/llvm-project/local/compiler-rt/test/asan/TestCases/alloca_vla_interact.cpp, line 45

Linux/sparc64 is worse, but AFAICS none of the failures there are related to this patch, just Linux/sparc64 specific issues.
Thanks again!

I admit I still find it hard to understand what is this testing, so may I ask for some explaination? I'm not very familiar with the constructs used there, and, particularly, the asan functions...

Hi, sorry for the late response, I took some time for me to restore my GH account...

I don't remember all the details, but from what I remember, when implementing VLA/alloca poisoning, LLVM showed different behavior for allocation slots management between VLAs/allocas into loop nest:

  • for VLA, I saw its stack slot being reused between loop iterations (i.e. each VLA's alloca was preceded by @llvm.stacksave.p0() all and followed by corresponding @llvm.stackrestore.p0(...).
  • for alloca I saw LLVM allocating a new stack slot on each loop iteration (no reuse).

So the test case was indented to check that ASAN can handle poisoning/unpoisoning correctly in presence of both VLAs/allocas into same loop nest.

However, looking on freshly generated LLVM IR, it seems this difference is not the case anymore, maybe it was a bug in LLVM back then...
That said, I think this test case doesn't have value anymore (and maybe it's even invalid now).

I'm sorry that I can't provide more technical details now, this patch is pretty old...

@koachan
Copy link
Contributor Author

koachan commented Oct 3, 2024

That said, I'm fine with merging the patch now, with one caveat: please first file an Issue for the remaining failure with everything that's known about the issue

Posted the issue tracker at #110956.

then XFAIL the testcase on SPARC to avoid the Solaris/sparcv9 bot turning red immediately (oh wait, it already is due to PR #106951 ;-().

The buildbot should be green again now :)

xgupta pushed a commit to xgupta/llvm-project that referenced this pull request Oct 4, 2024
Once PR llvm#107223 lands, ASan can be enabled on Solaris/SPARC. This patch
does just that. As on Solaris/x86, the dynamic ASan runtime lib needs to
be linked with `-z now` to avoid an `AsanInitInternal` cycle.

Tested on `sparcv9-sun-solaris2.11` and `sparc64-unknown-linux-gnu`.
@rorth
Copy link
Collaborator

rorth commented Oct 7, 2024

That said, I'm fine with merging the patch now, with one caveat: please first file an Issue for the remaining failure with everything that's known about the issue

Posted the issue tracker at #110956.

Fine, thanks.

then XFAIL the testcase on SPARC to avoid the Solaris/sparcv9 bot turning red immediately (oh wait, it already is due to PR #106951 ;-().

The buildbot should be green again now :)

It is indeed. I wonder what to do about the testcase now. I guess there are 3 options:

  • XFAIL it on SPARC, referencing the Issue.
  • Mark the test UNSUPPORTED everywhere.
  • Remove it wholesale.

@koachan
Copy link
Contributor Author

koachan commented Oct 12, 2024

Okay, XFAIL-ed the test on SPARC for now.
If it turns out that the test is not relevant anymore then I think it's better to do the removal as a separate PR.

@koachan
Copy link
Contributor Author

koachan commented Oct 20, 2024

Ping?

@brad0
Copy link
Contributor

brad0 commented Oct 26, 2024

@s-barannikov

@brad0
Copy link
Contributor

brad0 commented Nov 1, 2024

@s-barannikov

Copy link
Contributor

@s-barannikov s-barannikov left a comment

Choose a reason for hiding this comment

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

LGTM (I didn't look closely at the tests)

@koachan koachan merged commit 23d209f into llvm:main Nov 3, 2024
6 of 8 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 3, 2024

LLVM Buildbot has detected a new failure on builder openmp-s390x-linux running on systemz-1 while building compiler-rt,llvm at step 6 "test-openmp".

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

Here is the relevant piece of the build log for the reference
Step 6 (test-openmp) failure: test (failure)
******************** TEST 'libomp :: tasking/issue-94260-2.c' FAILED ********************
Exit Code: -11

Command Output (stdout):
--
# RUN: at line 1
/home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.build/./bin/clang -fopenmp   -I /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -I /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test -L /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.build/runtimes/runtimes-bins/openmp/runtime/src  -fno-omit-frame-pointer -mbackchain -I /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test/ompt /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test/tasking/issue-94260-2.c -o /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.build/runtimes/runtimes-bins/openmp/runtime/test/tasking/Output/issue-94260-2.c.tmp -lm -latomic && /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.build/runtimes/runtimes-bins/openmp/runtime/test/tasking/Output/issue-94260-2.c.tmp
# executed command: /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.build/./bin/clang -fopenmp -I /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -I /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test -L /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -fno-omit-frame-pointer -mbackchain -I /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test/ompt /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test/tasking/issue-94260-2.c -o /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.build/runtimes/runtimes-bins/openmp/runtime/test/tasking/Output/issue-94260-2.c.tmp -lm -latomic
# executed command: /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.build/runtimes/runtimes-bins/openmp/runtime/test/tasking/Output/issue-94260-2.c.tmp
# note: command had no output on stdout or stderr
# error: command failed with exit status: -11

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 3, 2024

LLVM Buildbot has detected a new failure on builder sanitizer-x86_64-linux running on sanitizer-buildbot1 while building compiler-rt,llvm at step 2 "annotate".

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

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)
...
[4563/5328] Building CXX object lib/CodeGen/SelectionDAG/CMakeFiles/LLVMSelectionDAG.dir/FunctionLoweringInfo.cpp.o
[4564/5328] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcISelDAGToDAG.cpp.o
[4565/5328] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcSubtarget.cpp.o
[4566/5328] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcRegisterInfo.cpp.o
[4567/5328] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/LeonPasses.cpp.o
[4568/5328] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcTargetMachine.cpp.o
[4569/5328] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcInstrInfo.cpp.o
[4570/5328] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcAsmPrinter.cpp.o
[4571/5328] Building RISCVGenInstrInfo.inc...
[4572/5328] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o
FAILED: lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /home/b/sanitizer-x86_64-linux/build/llvm_build0/bin/clang++ -DGTEST_HAS_RTTI=0 -DLLVM_EXPORTS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/b/sanitizer-x86_64-linux/build/build_default/lib/Target/Sparc -I/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Target/Sparc -I/home/b/sanitizer-x86_64-linux/build/build_default/include -I/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17 -fvisibility=hidden  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -MF lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o.d -o lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -c /home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp
/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp:226:29: error: unused variable 'RegInfo' [-Werror,-Wunused-variable]
  226 |   const TargetRegisterInfo *RegInfo = MF.getSubtarget().getRegisterInfo();
      |                             ^~~~~~~
1 error generated.
[4573/5328] Building X86GenInstrInfo.inc...
[4574/5328] Building RISCVGenGlobalISel.inc...
[4575/5328] Building CXX object lib/CodeGen/SelectionDAG/CMakeFiles/LLVMSelectionDAG.dir/FastISel.cpp.o
[4576/5328] Building CXX object lib/CodeGen/AsmPrinter/CMakeFiles/LLVMAsmPrinter.dir/DwarfCompileUnit.cpp.o
[4577/5328] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcISelLowering.cpp.o
[4578/5328] Building RISCVGenDAGISel.inc...
[4579/5328] Building CXX object lib/CodeGen/AsmPrinter/CMakeFiles/LLVMAsmPrinter.dir/AsmPrinter.cpp.o
[4580/5328] Building AMDGPUGenAsmWriter.inc...
[4581/5328] Building CXX object lib/CodeGen/AsmPrinter/CMakeFiles/LLVMAsmPrinter.dir/CodeViewDebug.cpp.o
[4582/5328] Building CXX object lib/CodeGen/SelectionDAG/CMakeFiles/LLVMSelectionDAG.dir/TargetLowering.cpp.o
[4583/5328] Building AMDGPUGenGlobalISel.inc...
[4584/5328] Building AMDGPUGenAsmMatcher.inc...
[4585/5328] Building AMDGPUGenDAGISel.inc...
[4586/5328] Building AMDGPUGenInstrInfo.inc...
[4587/5328] Building CXX object lib/CodeGen/AsmPrinter/CMakeFiles/LLVMAsmPrinter.dir/DwarfDebug.cpp.o
[4588/5328] Building CXX object lib/CodeGen/SelectionDAG/CMakeFiles/LLVMSelectionDAG.dir/SelectionDAGBuilder.cpp.o
[4589/5328] Building AMDGPUGenRegisterBank.inc...
[4590/5328] Building RISCVGenSubtargetInfo.inc...
[4591/5328] Building AMDGPUGenRegisterInfo.inc...
[4592/5328] Building CXX object lib/CodeGen/SelectionDAG/CMakeFiles/LLVMSelectionDAG.dir/DAGCombiner.cpp.o
ninja: build stopped: subcommand failed.

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild

@@@STEP_FAILURE@@@
@@@BUILD_STEP test compiler-rt symbolizer@@@
ninja: Entering directory `build_default'
[1/500] Building CXX object lib/Target/RISCV/TargetInfo/CMakeFiles/LLVMRISCVInfo.dir/RISCVTargetInfo.cpp.o
[2/500] Building CXX object lib/Target/X86/TargetInfo/CMakeFiles/LLVMX86Info.dir/X86TargetInfo.cpp.o
[3/500] Linking CXX static library lib/libLLVMSelectionDAG.a
[4/500] Building CXX object lib/Target/RISCV/MCTargetDesc/CMakeFiles/LLVMRISCVDesc.dir/RISCVMCAsmInfo.cpp.o
[5/500] Linking CXX static library lib/libLLVMAsmPrinter.a
[6/500] Linking CXX static library lib/libLLVMX86Info.a
Step 8 (build compiler-rt symbolizer) failure: build compiler-rt symbolizer (failure)
...
[4563/5328] Building CXX object lib/CodeGen/SelectionDAG/CMakeFiles/LLVMSelectionDAG.dir/FunctionLoweringInfo.cpp.o
[4564/5328] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcISelDAGToDAG.cpp.o
[4565/5328] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcSubtarget.cpp.o
[4566/5328] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcRegisterInfo.cpp.o
[4567/5328] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/LeonPasses.cpp.o
[4568/5328] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcTargetMachine.cpp.o
[4569/5328] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcInstrInfo.cpp.o
[4570/5328] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcAsmPrinter.cpp.o
[4571/5328] Building RISCVGenInstrInfo.inc...
[4572/5328] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o
FAILED: lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /home/b/sanitizer-x86_64-linux/build/llvm_build0/bin/clang++ -DGTEST_HAS_RTTI=0 -DLLVM_EXPORTS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/b/sanitizer-x86_64-linux/build/build_default/lib/Target/Sparc -I/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Target/Sparc -I/home/b/sanitizer-x86_64-linux/build/build_default/include -I/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17 -fvisibility=hidden  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -MF lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o.d -o lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -c /home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp
/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp:226:29: error: unused variable 'RegInfo' [-Werror,-Wunused-variable]
  226 |   const TargetRegisterInfo *RegInfo = MF.getSubtarget().getRegisterInfo();
      |                             ^~~~~~~
1 error generated.
[4573/5328] Building X86GenInstrInfo.inc...
[4574/5328] Building RISCVGenGlobalISel.inc...
[4575/5328] Building CXX object lib/CodeGen/SelectionDAG/CMakeFiles/LLVMSelectionDAG.dir/FastISel.cpp.o
[4576/5328] Building CXX object lib/CodeGen/AsmPrinter/CMakeFiles/LLVMAsmPrinter.dir/DwarfCompileUnit.cpp.o
[4577/5328] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcISelLowering.cpp.o
[4578/5328] Building RISCVGenDAGISel.inc...
[4579/5328] Building CXX object lib/CodeGen/AsmPrinter/CMakeFiles/LLVMAsmPrinter.dir/AsmPrinter.cpp.o
[4580/5328] Building AMDGPUGenAsmWriter.inc...
[4581/5328] Building CXX object lib/CodeGen/AsmPrinter/CMakeFiles/LLVMAsmPrinter.dir/CodeViewDebug.cpp.o
[4582/5328] Building CXX object lib/CodeGen/SelectionDAG/CMakeFiles/LLVMSelectionDAG.dir/TargetLowering.cpp.o
[4583/5328] Building AMDGPUGenGlobalISel.inc...
[4584/5328] Building AMDGPUGenAsmMatcher.inc...
[4585/5328] Building AMDGPUGenDAGISel.inc...
[4586/5328] Building AMDGPUGenInstrInfo.inc...
[4587/5328] Building CXX object lib/CodeGen/AsmPrinter/CMakeFiles/LLVMAsmPrinter.dir/DwarfDebug.cpp.o
[4588/5328] Building CXX object lib/CodeGen/SelectionDAG/CMakeFiles/LLVMSelectionDAG.dir/SelectionDAGBuilder.cpp.o
[4589/5328] Building AMDGPUGenRegisterBank.inc...
[4590/5328] Building RISCVGenSubtargetInfo.inc...
[4591/5328] Building AMDGPUGenRegisterInfo.inc...
[4592/5328] Building CXX object lib/CodeGen/SelectionDAG/CMakeFiles/LLVMSelectionDAG.dir/DAGCombiner.cpp.o
ninja: build stopped: subcommand failed.

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild
Step 9 (test compiler-rt symbolizer) failure: test compiler-rt symbolizer (failure)
...
[162/500] Linking CXX static library lib/libLLVMXCoreCodeGen.a
[163/500] Linking CXX static library lib/libLLVMRISCVDesc.a
[164/500] Linking CXX static library lib/libLLVMX86Disassembler.a
[165/500] Linking CXX static library lib/libLLVMX86AsmParser.a
[166/500] Linking CXX static library lib/libLLVMRISCVAsmParser.a
[167/500] Linking CXX static library lib/libLLVMRISCVDisassembler.a
[168/500] Linking CXX static library lib/libLLVMRISCVCodeGen.a
[169/500] Linking CXX static library lib/libLLVMX86CodeGen.a
[170/500] Linking CXX executable bin/lli
[171/500] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o
FAILED: lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /home/b/sanitizer-x86_64-linux/build/llvm_build0/bin/clang++ -DGTEST_HAS_RTTI=0 -DLLVM_EXPORTS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/b/sanitizer-x86_64-linux/build/build_default/lib/Target/Sparc -I/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Target/Sparc -I/home/b/sanitizer-x86_64-linux/build/build_default/include -I/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17 -fvisibility=hidden  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -MF lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o.d -o lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -c /home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp
/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp:226:29: error: unused variable 'RegInfo' [-Werror,-Wunused-variable]
  226 |   const TargetRegisterInfo *RegInfo = MF.getSubtarget().getRegisterInfo();
      |                             ^~~~~~~
1 error generated.
[172/500] Building InstCombineTables.inc...
ninja: build stopped: subcommand failed.

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild
Step 10 (build compiler-rt debug) failure: build compiler-rt debug (failure)
...
[4595/5328] Linking CXX executable bin/llvm-extract
[4596/5328] Linking CXX shared module lib/CheckerDependencyHandlingAnalyzerPlugin.so
[4597/5328] Linking CXX executable bin/arcmt-test
[4598/5328] Linking CXX shared module lib/SampleAnalyzerPlugin.so
[4599/5328] Linking CXX shared module lib/CheckerOptionHandlingAnalyzerPlugin.so
[4600/5328] Linking CXX executable bin/clang-diff
[4601/5328] Linking CXX executable bin/clang-refactor
[4602/5328] Linking CXX executable bin/clang-installapi
[4603/5328] Linking CXX executable bin/clang-import-test
[4604/5328] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o
FAILED: lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /home/b/sanitizer-x86_64-linux/build/llvm_build0/bin/clang++ -DGTEST_HAS_RTTI=0 -DLLVM_EXPORTS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/b/sanitizer-x86_64-linux/build/build_default/lib/Target/Sparc -I/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Target/Sparc -I/home/b/sanitizer-x86_64-linux/build/build_default/include -I/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17 -fvisibility=hidden  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -MF lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o.d -o lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -c /home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp
/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp:226:29: error: unused variable 'RegInfo' [-Werror,-Wunused-variable]
  226 |   const TargetRegisterInfo *RegInfo = MF.getSubtarget().getRegisterInfo();
      |                             ^~~~~~~
1 error generated.
[4605/5328] Building RISCVGenInstrInfo.inc...
[4606/5328] Building X86GenInstrInfo.inc...
[4607/5328] Building RISCVGenGlobalISel.inc...
[4608/5328] Building AMDGPUGenAsmWriter.inc...
[4609/5328] Building RISCVGenDAGISel.inc...
[4610/5328] Building AMDGPUGenGlobalISel.inc...
[4611/5328] Building AMDGPUGenDAGISel.inc...
[4612/5328] Building AMDGPUGenAsmMatcher.inc...
[4613/5328] Building AMDGPUGenInstrInfo.inc...
[4614/5328] Building RISCVGenSubtargetInfo.inc...
[4615/5328] Building AMDGPUGenRegisterInfo.inc...
[4616/5328] Building AMDGPUGenRegisterBank.inc...
ninja: build stopped: subcommand failed.

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild
Step 11 (test compiler-rt debug) failure: test compiler-rt debug (failure)
...
[144/482] Linking CXX static library lib/libLLVMRISCVDesc.a
[145/482] Linking CXX static library lib/libLLVMX86Desc.a
[146/482] Linking CXX static library lib/libLLVMRISCVAsmParser.a
[147/482] Linking CXX static library lib/libLLVMX86AsmParser.a
[148/482] Linking CXX static library lib/libLLVMX86Disassembler.a
[149/482] Linking CXX static library lib/libLLVMRISCVDisassembler.a
[150/482] Linking CXX static library lib/libLLVMRISCVCodeGen.a
[151/482] Linking CXX static library lib/libLLVMX86CodeGen.a
[152/482] Linking CXX executable bin/lli
[153/482] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o
FAILED: lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /home/b/sanitizer-x86_64-linux/build/llvm_build0/bin/clang++ -DGTEST_HAS_RTTI=0 -DLLVM_EXPORTS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/b/sanitizer-x86_64-linux/build/build_default/lib/Target/Sparc -I/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Target/Sparc -I/home/b/sanitizer-x86_64-linux/build/build_default/include -I/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17 -fvisibility=hidden  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -MF lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o.d -o lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -c /home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp
/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp:226:29: error: unused variable 'RegInfo' [-Werror,-Wunused-variable]
  226 |   const TargetRegisterInfo *RegInfo = MF.getSubtarget().getRegisterInfo();
      |                             ^~~~~~~
1 error generated.
[154/482] Building InstCombineTables.inc...
ninja: build stopped: subcommand failed.

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild
Step 12 (build compiler-rt tsan_debug) failure: build compiler-rt tsan_debug (failure)
...
[4576/5309] Linking CXX executable bin/arcmt-test
[4577/5309] Linking CXX executable bin/clang-refactor
[4578/5309] Linking CXX shared module lib/SampleAnalyzerPlugin.so
[4579/5309] Linking CXX executable bin/clang-diff
[4580/5309] Building X86GenDAGISel.inc...
[4581/5309] Linking CXX executable bin/clang-installapi
[4582/5309] Linking CXX executable bin/clang-import-test
[4583/5309] Building X86GenSubtargetInfo.inc...
[4584/5309] Building AMDGPUGenSearchableTables.inc...
[4585/5309] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o
FAILED: lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /home/b/sanitizer-x86_64-linux/build/llvm_build0/bin/clang++ -DGTEST_HAS_RTTI=0 -DLLVM_EXPORTS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/b/sanitizer-x86_64-linux/build/build_default/lib/Target/Sparc -I/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Target/Sparc -I/home/b/sanitizer-x86_64-linux/build/build_default/include -I/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17 -fvisibility=hidden  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -MF lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o.d -o lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -c /home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp
/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp:226:29: error: unused variable 'RegInfo' [-Werror,-Wunused-variable]
  226 |   const TargetRegisterInfo *RegInfo = MF.getSubtarget().getRegisterInfo();
      |                             ^~~~~~~
1 error generated.
[4586/5309] Building RISCVGenInstrInfo.inc...
[4587/5309] Building X86GenInstrInfo.inc...
[4588/5309] Building RISCVGenGlobalISel.inc...
[4589/5309] Building RISCVGenDAGISel.inc...
[4590/5309] Building AMDGPUGenGlobalISel.inc...
[4591/5309] Building AMDGPUGenDAGISel.inc...
[4592/5309] Building AMDGPUGenAsmWriter.inc...
[4593/5309] Building AMDGPUGenAsmMatcher.inc...
[4594/5309] Building AMDGPUGenInstrInfo.inc...
[4595/5309] Building AMDGPUGenRegisterBank.inc...
[4596/5309] Building RISCVGenSubtargetInfo.inc...
[4597/5309] Building AMDGPUGenRegisterInfo.inc...
ninja: build stopped: subcommand failed.

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild
Step 13 (build compiler-rt default) failure: build compiler-rt default (failure)
...
[4696/5328] Building CXX object lib/Target/X86/AsmParser/CMakeFiles/LLVMX86AsmParser.dir/X86AsmParser.cpp.o
[4697/5328] Linking CXX static library lib/libLLVMX86Desc.a
[4698/5328] Linking CXX static library lib/libLLVMX86Disassembler.a
[4699/5328] Linking CXX static library lib/libLLVMX86AsmParser.a
[4700/5328] Linking CXX static library lib/libLLVMX86TargetMCA.a
[4701/5328] Linking CXX static library lib/libLLVMX86CodeGen.a
[4702/5328] Linking CXX static library lib/libclangInterpreter.a
[4703/5328] Linking CXX static library lib/libclangHandleLLVM.a
[4704/5328] Linking CXX static library lib/libLLVMExegesisX86.a
[4705/5328] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o
FAILED: lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /home/b/sanitizer-x86_64-linux/build/llvm_build0/bin/clang++ -DGTEST_HAS_RTTI=0 -DLLVM_EXPORTS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/b/sanitizer-x86_64-linux/build/build_default/lib/Target/Sparc -I/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Target/Sparc -I/home/b/sanitizer-x86_64-linux/build/build_default/include -I/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17 -fvisibility=hidden  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -MF lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o.d -o lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -c /home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp
/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp:226:29: error: unused variable 'RegInfo' [-Werror,-Wunused-variable]
  226 |   const TargetRegisterInfo *RegInfo = MF.getSubtarget().getRegisterInfo();
      |                             ^~~~~~~
1 error generated.
[4706/5328] Linking CXX executable bin/lli
[4707/5328] Building RISCVGenGlobalISel.inc...
[4708/5328] Linking CXX executable bin/llvm-exegesis
[4709/5328] Building RISCVGenDAGISel.inc...
[4710/5328] Building AMDGPUGenAsmWriter.inc...
[4711/5328] Building AMDGPUGenGlobalISel.inc...
[4712/5328] Building RISCVGenSubtargetInfo.inc...
[4713/5328] Building AMDGPUGenDAGISel.inc...
[4714/5328] Building AMDGPUGenInstrInfo.inc...
[4715/5328] Building AMDGPUGenAsmMatcher.inc...
[4716/5328] Building AMDGPUGenRegisterBank.inc...
[4717/5328] Building AMDGPUGenRegisterInfo.inc...
ninja: build stopped: subcommand failed.

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild
Step 14 (test compiler-rt default) failure: test compiler-rt default (failure)
...
[52/390] Building CXX object lib/Target/RISCV/CMakeFiles/LLVMRISCVCodeGen.dir/RISCVZacasABIFix.cpp.o
[53/390] Building CXX object lib/Target/RISCV/CMakeFiles/LLVMRISCVCodeGen.dir/GISel/RISCVPreLegalizerCombiner.cpp.o
[54/390] Building CXX object lib/Target/RISCV/CMakeFiles/LLVMRISCVCodeGen.dir/GISel/RISCVRegisterBankInfo.cpp.o
[55/390] Building CXX object lib/Target/RISCV/AsmParser/CMakeFiles/LLVMRISCVAsmParser.dir/RISCVAsmParser.cpp.o
[56/390] Linking CXX static library lib/libLLVMRISCVDesc.a
[57/390] Linking CXX static library lib/libLLVMRISCVDisassembler.a
[58/390] Linking CXX static library lib/libLLVMRISCVAsmParser.a
[59/390] Building CXX object lib/Target/RISCV/CMakeFiles/LLVMRISCVCodeGen.dir/GISel/RISCVInstructionSelector.cpp.o
[60/390] Linking CXX static library lib/libLLVMRISCVCodeGen.a
[61/390] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o
FAILED: lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /home/b/sanitizer-x86_64-linux/build/llvm_build0/bin/clang++ -DGTEST_HAS_RTTI=0 -DLLVM_EXPORTS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/b/sanitizer-x86_64-linux/build/build_default/lib/Target/Sparc -I/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Target/Sparc -I/home/b/sanitizer-x86_64-linux/build/build_default/include -I/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17 -fvisibility=hidden  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -MF lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o.d -o lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -c /home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp
/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp:226:29: error: unused variable 'RegInfo' [-Werror,-Wunused-variable]
  226 |   const TargetRegisterInfo *RegInfo = MF.getSubtarget().getRegisterInfo();
      |                             ^~~~~~~
1 error generated.
[62/390] Building InstCombineTables.inc...
ninja: build stopped: subcommand failed.

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild
Step 15 (build standalone compiler-rt) failure: build standalone compiler-rt (failure)
...
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  CMakeLists.txt:12 (include)
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- The ASM compiler identification is unknown
-- Didn't find assembler
CMake Error at CMakeLists.txt:22 (project):
  The CMAKE_C_COMPILER:

    /home/b/sanitizer-x86_64-linux/build/build_default/bin/clang

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:22 (project):
  The CMAKE_CXX_COMPILER:

    /home/b/sanitizer-x86_64-linux/build/build_default/bin/clang++

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:22 (project):
  No CMAKE_ASM_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "ASM" or the CMake cache entry CMAKE_ASM_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.
-- Warning: Did not find file Compiler/-ASM
-- Configuring incomplete, errors occurred!

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild
ninja: Entering directory `compiler_rt_build'
ninja: error: loading 'build.ninja': No such file or directory

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild

@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 3, 2024

LLVM Buildbot has detected a new failure on builder clang-ppc64le-rhel running on ppc64le-clang-rhel-test while building compiler-rt,llvm at step 5 "build-unified-tree".

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

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
9.584 [267/13/236] Linking CXX shared library lib/libclangAnalysisFlowSensitive.so.20.0git
9.593 [266/13/237] Creating library symlink lib/libclangAnalysisFlowSensitive.so
9.626 [265/13/238] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcSubtarget.cpp.o
9.654 [265/12/239] Linking CXX shared library lib/libclangAnalysisFlowSensitiveModels.so.20.0git
9.663 [264/12/240] Creating library symlink lib/libclangAnalysisFlowSensitiveModels.so
9.732 [264/11/241] Building CXX object tools/lld/Common/CMakeFiles/lldCommon.dir/Version.cpp.o
9.764 [263/11/242] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/DelaySlotFiller.cpp.o
9.786 [263/10/243] Linking CXX shared library lib/liblldCommon.so.20.0git
9.792 [262/10/244] Creating library symlink lib/liblldCommon.so
9.917 [262/9/245] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o
FAILED: lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o 
ccache /home/docker/llvm-external-buildbots/clang.17.0.6/bin/clang++ --gcc-toolchain=/gcc-toolchain/usr -DGTEST_HAS_RTTI=0 -DLLVM_EXPORTS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/lib/Target/Sparc -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/lib/Target/Sparc -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17 -fPIC  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -MF lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o.d -o lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -c /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp:226:29: error: unused variable 'RegInfo' [-Werror,-Wunused-variable]
  226 |   const TargetRegisterInfo *RegInfo = MF.getSubtarget().getRegisterInfo();
      |                             ^~~~~~~
1 error generated.
9.932 [262/8/246] Linking CXX shared library lib/libclangSema.so.20.0git
10.016 [262/7/247] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcInstrInfo.cpp.o
10.491 [262/6/248] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/LeonPasses.cpp.o
10.638 [262/5/249] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcAsmPrinter.cpp.o
10.798 [262/4/250] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcISelDAGToDAG.cpp.o
13.143 [262/3/251] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcISelLowering.cpp.o
23.180 [262/2/252] Building CXX object lib/CodeGen/AsmPrinter/CMakeFiles/LLVMAsmPrinter.dir/AsmPrinter.cpp.o
24.778 [262/1/253] Building CXX object lib/LTO/CMakeFiles/LLVMLTO.dir/LTO.cpp.o
ninja: build stopped: subcommand failed.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 3, 2024

LLVM Buildbot has detected a new failure on builder sanitizer-aarch64-linux running on sanitizer-buildbot8 while building compiler-rt,llvm at step 2 "annotate".

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

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)
...
[4062/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/Checker.cpp.o
[4063/5324] Building CXX object tools/clang/lib/Tooling/Refactoring/CMakeFiles/obj.clangToolingRefactoring.dir/AtomicChange.cpp.o
[4064/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CheckerRegistryData.cpp.o
[4065/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CommonBugCategories.cpp.o
[4066/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ConstraintManager.cpp.o
[4067/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/DynamicExtent.cpp.o
[4068/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/DynamicType.cpp.o
[4069/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/Environment.cpp.o
[4070/5324] Building CXX object tools/clang/lib/Tooling/Syntax/CMakeFiles/obj.clangToolingSyntax.dir/Tokens.cpp.o
[4071/5324] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o
FAILED: lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /home/b/sanitizer-aarch64-linux/build/llvm_build0/bin/clang++ -DGTEST_HAS_RTTI=0 -DLLVM_EXPORTS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/b/sanitizer-aarch64-linux/build/build_default/lib/Target/Sparc -I/home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/lib/Target/Sparc -I/home/b/sanitizer-aarch64-linux/build/build_default/include -I/home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17 -fvisibility=hidden  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -MF lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o.d -o lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -c /home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp
/home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp:226:29: error: unused variable 'RegInfo' [-Werror,-Wunused-variable]
  226 |   const TargetRegisterInfo *RegInfo = MF.getSubtarget().getRegisterInfo();
      |                             ^~~~~~~
1 error generated.
[4072/5324] Building CXX object tools/clang/lib/FrontendTool/CMakeFiles/obj.clangFrontendTool.dir/ExecuteCompilerInvocation.cpp.o
[4073/5324] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/CompilationDatabase.cpp.o
[4074/5324] Building CXX object tools/clang/lib/Tooling/Refactoring/CMakeFiles/obj.clangToolingRefactoring.dir/RefactoringActions.cpp.o
[4075/5324] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/RefactoringCallbacks.cpp.o
[4076/5324] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/Tooling.cpp.o
[4077/5324] Building CXX object tools/clang/lib/Index/CMakeFiles/obj.clangIndex.dir/IndexDecl.cpp.o
[4078/5324] Building CXX object tools/clang/lib/Index/CMakeFiles/obj.clangIndex.dir/IndexingContext.cpp.o
[4079/5324] Building CXX object tools/clang/lib/Tooling/DependencyScanning/CMakeFiles/obj.clangDependencyScanning.dir/ModuleDepCollector.cpp.o
[4080/5324] Building CXX object tools/clang/lib/Tooling/Refactoring/CMakeFiles/obj.clangToolingRefactoring.dir/Rename/RenamingAction.cpp.o
[4081/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CoreEngine.cpp.o
[4082/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CallEvent.cpp.o
[4083/5324] Building CXX object tools/clang/lib/Tooling/DependencyScanning/CMakeFiles/obj.clangDependencyScanning.dir/DependencyScanningWorker.cpp.o
[4084/5324] Building CXX object tools/clang/lib/Index/CMakeFiles/obj.clangIndex.dir/IndexingAction.cpp.o
[4085/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CallDescription.cpp.o
[4086/5324] Building CXX object tools/clang/lib/Tooling/Refactoring/CMakeFiles/obj.clangToolingRefactoring.dir/Rename/USRFindingAction.cpp.o
[4087/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CheckerHelpers.cpp.o
[4088/5324] Building CXX object tools/clang/lib/Index/CMakeFiles/obj.clangIndex.dir/IndexTypeSourceInfo.cpp.o
[4089/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CheckerContext.cpp.o
[4090/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/BugReporter.cpp.o
[4091/5324] Building CXX object tools/clang/lib/Index/CMakeFiles/obj.clangIndex.dir/IndexBody.cpp.o
[4092/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/BugReporterVisitors.cpp.o
[4093/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/AnalysisManager.cpp.o
[4094/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExprEngine.cpp.o
[4095/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/BugSuppression.cpp.o
[4096/5324] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/Visitor.cpp.o
[4097/5324] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/Frontend.cpp.o
[4098/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExplodedGraph.cpp.o
[4099/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CheckerManager.cpp.o
[4100/5324] Building X86GenGlobalISel.inc...
[4101/5324] Building X86GenDAGISel.inc...
[4102/5324] Building AMDGPUGenAsmWriter.inc...
[4103/5324] Building X86GenSubtargetInfo.inc...
[4104/5324] Building AMDGPUGenGlobalISel.inc...
Step 8 (build compiler-rt symbolizer) failure: build compiler-rt symbolizer (failure)
...
[4062/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/Checker.cpp.o
[4063/5324] Building CXX object tools/clang/lib/Tooling/Refactoring/CMakeFiles/obj.clangToolingRefactoring.dir/AtomicChange.cpp.o
[4064/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CheckerRegistryData.cpp.o
[4065/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CommonBugCategories.cpp.o
[4066/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ConstraintManager.cpp.o
[4067/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/DynamicExtent.cpp.o
[4068/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/DynamicType.cpp.o
[4069/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/Environment.cpp.o
[4070/5324] Building CXX object tools/clang/lib/Tooling/Syntax/CMakeFiles/obj.clangToolingSyntax.dir/Tokens.cpp.o
[4071/5324] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o
FAILED: lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /home/b/sanitizer-aarch64-linux/build/llvm_build0/bin/clang++ -DGTEST_HAS_RTTI=0 -DLLVM_EXPORTS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/b/sanitizer-aarch64-linux/build/build_default/lib/Target/Sparc -I/home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/lib/Target/Sparc -I/home/b/sanitizer-aarch64-linux/build/build_default/include -I/home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17 -fvisibility=hidden  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -MF lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o.d -o lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -c /home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp
/home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp:226:29: error: unused variable 'RegInfo' [-Werror,-Wunused-variable]
  226 |   const TargetRegisterInfo *RegInfo = MF.getSubtarget().getRegisterInfo();
      |                             ^~~~~~~
1 error generated.
[4072/5324] Building CXX object tools/clang/lib/FrontendTool/CMakeFiles/obj.clangFrontendTool.dir/ExecuteCompilerInvocation.cpp.o
[4073/5324] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/CompilationDatabase.cpp.o
[4074/5324] Building CXX object tools/clang/lib/Tooling/Refactoring/CMakeFiles/obj.clangToolingRefactoring.dir/RefactoringActions.cpp.o
[4075/5324] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/RefactoringCallbacks.cpp.o
[4076/5324] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/Tooling.cpp.o
[4077/5324] Building CXX object tools/clang/lib/Index/CMakeFiles/obj.clangIndex.dir/IndexDecl.cpp.o
[4078/5324] Building CXX object tools/clang/lib/Index/CMakeFiles/obj.clangIndex.dir/IndexingContext.cpp.o
[4079/5324] Building CXX object tools/clang/lib/Tooling/DependencyScanning/CMakeFiles/obj.clangDependencyScanning.dir/ModuleDepCollector.cpp.o
[4080/5324] Building CXX object tools/clang/lib/Tooling/Refactoring/CMakeFiles/obj.clangToolingRefactoring.dir/Rename/RenamingAction.cpp.o
[4081/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CoreEngine.cpp.o
[4082/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CallEvent.cpp.o
[4083/5324] Building CXX object tools/clang/lib/Tooling/DependencyScanning/CMakeFiles/obj.clangDependencyScanning.dir/DependencyScanningWorker.cpp.o
[4084/5324] Building CXX object tools/clang/lib/Index/CMakeFiles/obj.clangIndex.dir/IndexingAction.cpp.o
[4085/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CallDescription.cpp.o
[4086/5324] Building CXX object tools/clang/lib/Tooling/Refactoring/CMakeFiles/obj.clangToolingRefactoring.dir/Rename/USRFindingAction.cpp.o
[4087/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CheckerHelpers.cpp.o
[4088/5324] Building CXX object tools/clang/lib/Index/CMakeFiles/obj.clangIndex.dir/IndexTypeSourceInfo.cpp.o
[4089/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CheckerContext.cpp.o
[4090/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/BugReporter.cpp.o
[4091/5324] Building CXX object tools/clang/lib/Index/CMakeFiles/obj.clangIndex.dir/IndexBody.cpp.o
[4092/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/BugReporterVisitors.cpp.o
[4093/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/AnalysisManager.cpp.o
[4094/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExprEngine.cpp.o
[4095/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/BugSuppression.cpp.o
[4096/5324] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/Visitor.cpp.o
[4097/5324] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/Frontend.cpp.o
[4098/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExplodedGraph.cpp.o
[4099/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CheckerManager.cpp.o
[4100/5324] Building X86GenGlobalISel.inc...
[4101/5324] Building X86GenDAGISel.inc...
[4102/5324] Building AMDGPUGenAsmWriter.inc...
[4103/5324] Building X86GenSubtargetInfo.inc...
[4104/5324] Building AMDGPUGenGlobalISel.inc...
Step 9 (test compiler-rt symbolizer) failure: test compiler-rt symbolizer (failure)
...
[423/761] Generating ../../bin/llvm-readelf
[424/761] Linking CXX executable bin/sanstats
[425/761] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/WebKit/RawPtrRefLocalVarsChecker.cpp.o
[426/761] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/WebKit/UncountedCallArgsChecker.cpp.o
[427/761] Linking CXX static library lib/libclangStaticAnalyzerCheckers.a
[428/761] Building CXX object tools/clang/lib/StaticAnalyzer/Frontend/CMakeFiles/obj.clangStaticAnalyzerFrontend.dir/AnalysisConsumer.cpp.o
[429/761] Linking CXX static library lib/libclangStaticAnalyzerFrontend.a
[430/761] Linking CXX static library lib/libclangFrontendTool.a
[431/761] Linking CXX executable bin/lli
[432/761] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o
FAILED: lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /home/b/sanitizer-aarch64-linux/build/llvm_build0/bin/clang++ -DGTEST_HAS_RTTI=0 -DLLVM_EXPORTS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/b/sanitizer-aarch64-linux/build/build_default/lib/Target/Sparc -I/home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/lib/Target/Sparc -I/home/b/sanitizer-aarch64-linux/build/build_default/include -I/home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17 -fvisibility=hidden  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -MF lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o.d -o lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -c /home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp
/home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp:226:29: error: unused variable 'RegInfo' [-Werror,-Wunused-variable]
  226 |   const TargetRegisterInfo *RegInfo = MF.getSubtarget().getRegisterInfo();
      |                             ^~~~~~~
1 error generated.
[433/761] Building InstCombineTables.inc...
ninja: build stopped: subcommand failed.

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild
Step 10 (build compiler-rt debug) failure: build compiler-rt debug (failure)
...
[4172/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/GCDAntipatternChecker.cpp.o
[4173/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/IdenticalExprChecker.cpp.o
[4174/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/InvalidatedIteratorChecker.cpp.o
[4175/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/GenericTaintChecker.cpp.o
[4176/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/IteratorModeling.cpp.o
[4177/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/IteratorRangeChecker.cpp.o
[4178/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/MismatchedIteratorChecker.cpp.o
[4179/5324] Building X86GenFastISel.inc...
[4180/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/MmapWriteExecChecker.cpp.o
[4181/5324] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o
FAILED: lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /home/b/sanitizer-aarch64-linux/build/llvm_build0/bin/clang++ -DGTEST_HAS_RTTI=0 -DLLVM_EXPORTS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/b/sanitizer-aarch64-linux/build/build_default/lib/Target/Sparc -I/home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/lib/Target/Sparc -I/home/b/sanitizer-aarch64-linux/build/build_default/include -I/home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17 -fvisibility=hidden  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -MF lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o.d -o lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -c /home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp
/home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp:226:29: error: unused variable 'RegInfo' [-Werror,-Wunused-variable]
  226 |   const TargetRegisterInfo *RegInfo = MF.getSubtarget().getRegisterInfo();
      |                             ^~~~~~~
1 error generated.
[4182/5324] Building X86GenGlobalISel.inc...
[4183/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/IvarInvalidationChecker.cpp.o
[4184/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/MacOSXAPIChecker.cpp.o
[4185/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/MPI-Checker/MPIFunctionClassifier.cpp.o
[4186/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/MPI-Checker/MPIBugReporter.cpp.o
[4187/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/NoReturnFunctionChecker.cpp.o
[4188/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/LLVMConventionsChecker.cpp.o
[4189/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/MIGChecker.cpp.o
[4190/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/MacOSKeychainAPIChecker.cpp.o
[4191/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/MallocSizeofChecker.cpp.o
[4192/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/MPI-Checker/MPIChecker.cpp.o
[4193/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/MallocChecker.cpp.o
[4194/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/NoOwnershipChangeVisitor.cpp.o
[4195/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/NonnullGlobalConstantsChecker.cpp.o
[4196/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/NSErrorChecker.cpp.o
[4197/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/LocalizationChecker.cpp.o
[4198/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/ObjCAtSyncChecker.cpp.o
[4199/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/NullabilityChecker.cpp.o
[4200/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/MoveChecker.cpp.o
[4201/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/ObjCContainersASTChecker.cpp.o
[4202/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/ObjCAutoreleaseWriteChecker.cpp.o
[4203/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/NumberObjectConversionChecker.cpp.o
[4204/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/ObjCUnusedIVarsChecker.cpp.o
[4205/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/ObjCSelfInitChecker.cpp.o
[4206/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/ObjCSuperDeallocChecker.cpp.o
[4207/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/NonNullParamChecker.cpp.o
[4208/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/NSAutoreleasePoolChecker.cpp.o
[4209/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/PaddingChecker.cpp.o
[4210/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/ObjCContainersChecker.cpp.o
[4211/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/PointerSubChecker.cpp.o
[4212/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/ObjCPropertyChecker.cpp.o
[4213/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/ObjCMissingSuperCallChecker.cpp.o
[4214/5324] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/PointerArithChecker.cpp.o
Step 11 (test compiler-rt debug) failure: test compiler-rt debug (failure)
...
[305/643] Linking CXX executable bin/llvm-objcopy
[306/643] Linking CXX executable bin/llvm-symbolizer
[307/643] Generating ../../bin/llvm-readelf
[308/643] Generating ../../bin/llvm-strip
[309/643] Linking CXX static library lib/libclangStaticAnalyzerFrontend.a
[310/643] Linking CXX executable bin/sanstats
[311/643] Linking CXX executable bin/obj2yaml
[312/643] Linking CXX static library lib/libclangFrontendTool.a
[313/643] Linking CXX executable bin/lli
[314/643] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o
FAILED: lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /home/b/sanitizer-aarch64-linux/build/llvm_build0/bin/clang++ -DGTEST_HAS_RTTI=0 -DLLVM_EXPORTS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/b/sanitizer-aarch64-linux/build/build_default/lib/Target/Sparc -I/home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/lib/Target/Sparc -I/home/b/sanitizer-aarch64-linux/build/build_default/include -I/home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17 -fvisibility=hidden  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -MF lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o.d -o lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -c /home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp
/home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp:226:29: error: unused variable 'RegInfo' [-Werror,-Wunused-variable]
  226 |   const TargetRegisterInfo *RegInfo = MF.getSubtarget().getRegisterInfo();
      |                             ^~~~~~~
1 error generated.
[315/643] Building InstCombineTables.inc...
ninja: build stopped: subcommand failed.

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild
Step 12 (build compiler-rt tsan_debug) failure: build compiler-rt tsan_debug (failure)
...
[4076/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/BasicObjCFoundationChecks.cpp.o
[4077/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/BlockInCriticalSectionChecker.cpp.o
[4078/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/ArrayBoundChecker.cpp.o
[4079/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/BuiltinFunctionChecker.cpp.o
[4080/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/ArrayBoundCheckerV2.cpp.o
[4081/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/CheckPlacementNew.cpp.o
[4082/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/CallAndMessageChecker.cpp.o
[4083/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/CastSizeChecker.cpp.o
[4084/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/CStringSyntaxChecker.cpp.o
[4085/5305] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o
FAILED: lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /home/b/sanitizer-aarch64-linux/build/llvm_build0/bin/clang++ -DGTEST_HAS_RTTI=0 -DLLVM_EXPORTS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/b/sanitizer-aarch64-linux/build/build_default/lib/Target/Sparc -I/home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/lib/Target/Sparc -I/home/b/sanitizer-aarch64-linux/build/build_default/include -I/home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17 -fvisibility=hidden  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -MF lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o.d -o lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -c /home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp
/home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp:226:29: error: unused variable 'RegInfo' [-Werror,-Wunused-variable]
  226 |   const TargetRegisterInfo *RegInfo = MF.getSubtarget().getRegisterInfo();
      |                             ^~~~~~~
1 error generated.
[4086/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/CastValueChecker.cpp.o
[4087/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/ContainerModeling.cpp.o
[4088/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/ChrootChecker.cpp.o
[4089/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/CheckObjCInstMethSignature.cpp.o
[4090/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/CastToStructChecker.cpp.o
[4091/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/CheckerDocumentation.cpp.o
[4092/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/CheckSecuritySyntaxOnly.cpp.o
[4093/5305] Building AArch64GenInstrInfo.inc...
[4094/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/CheckObjCDealloc.cpp.o
[4095/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/DebugIteratorModeling.cpp.o
[4096/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/CXXSelfAssignmentChecker.cpp.o
[4097/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/ConversionChecker.cpp.o
[4098/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/CloneChecker.cpp.o
[4099/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/DynamicTypePropagation.cpp.o
[4100/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/CXXDeleteChecker.cpp.o
[4101/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/ExprInspectionChecker.cpp.o
[4102/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/ErrnoChecker.cpp.o
[4103/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/ErrnoModeling.cpp.o
[4104/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/DynamicTypeChecker.cpp.o
[4105/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/DereferenceChecker.cpp.o
[4106/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/DirectIvarAssignment.cpp.o
[4107/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/DivZeroChecker.cpp.o
[4108/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/FixedAddressChecker.cpp.o
[4109/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/DebugCheckers.cpp.o
[4110/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/ErrnoTesterChecker.cpp.o
[4111/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/DebugContainerModeling.cpp.o
[4112/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/EnumCastOutOfRangeChecker.cpp.o
[4113/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/FuchsiaHandleChecker.cpp.o
[4114/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/DeadStoresChecker.cpp.o
[4115/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/GCDAntipatternChecker.cpp.o
[4116/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/InnerPointerChecker.cpp.o
[4117/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/GTestChecker.cpp.o
[4118/5305] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/GenericTaintChecker.cpp.o
Step 13 (build compiler-rt default) failure: build compiler-rt default (failure)
...
[4566/5324] Generating ../../bin/llvm-install-name-tool
[4567/5324] Generating ../../bin/llvm-bitcode-strip
[4568/5324] Generating ../../bin/llvm-strip
[4569/5324] Linking CXX executable bin/yaml2obj
[4570/5324] Linking CXX executable bin/llvm-xray
[4571/5324] Building CXX object tools/clang/tools/clang-installapi/CMakeFiles/clang-installapi.dir/ClangInstallAPI.cpp.o
[4572/5324] Linking CXX executable bin/obj2yaml
[4573/5324] Linking CXX executable bin/verify-uselistorder
[4574/5324] Linking CXX executable bin/sanstats
[4575/5324] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o
FAILED: lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /home/b/sanitizer-aarch64-linux/build/llvm_build0/bin/clang++ -DGTEST_HAS_RTTI=0 -DLLVM_EXPORTS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/b/sanitizer-aarch64-linux/build/build_default/lib/Target/Sparc -I/home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/lib/Target/Sparc -I/home/b/sanitizer-aarch64-linux/build/build_default/include -I/home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17 -fvisibility=hidden  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -MF lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o.d -o lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -c /home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp
/home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp:226:29: error: unused variable 'RegInfo' [-Werror,-Wunused-variable]
  226 |   const TargetRegisterInfo *RegInfo = MF.getSubtarget().getRegisterInfo();
      |                             ^~~~~~~
1 error generated.
[4576/5324] Building X86GenSubtargetInfo.inc...
[4577/5324] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/HIPUtility.cpp.o
[4578/5324] Building RISCVGenDAGISel.inc...
[4579/5324] Building X86GenInstrInfo.inc...
[4580/5324] Building RISCVGenInstrInfo.inc...
[4581/5324] Building AMDGPUGenAsmWriter.inc...
[4582/5324] Building AMDGPUGenAsmMatcher.inc...
[4583/5324] Building AMDGPUGenDAGISel.inc...
[4584/5324] Building AMDGPUGenInstrInfo.inc...
[4585/5324] Building RISCVGenGlobalISel.inc...
[4586/5324] Building AMDGPUGenGlobalISel.inc...
[4587/5324] Building AMDGPUGenRegisterBank.inc...
[4588/5324] Building RISCVGenSubtargetInfo.inc...
[4589/5324] Building AMDGPUGenRegisterInfo.inc...
ninja: build stopped: subcommand failed.

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild
Step 14 (test compiler-rt default) failure: test compiler-rt default (failure)
...
[154/492] Linking CXX static library lib/libLLVMX86CodeGen.a
[155/492] Linking CXX static library lib/libclangARCMigrate.a
[156/492] Linking CXX static library lib/libclangCrossTU.a
[157/492] Linking CXX static library lib/libclangExtractAPI.a
[158/492] Linking CXX static library lib/libclangCodeGen.a
[159/492] Linking CXX static library lib/libclangStaticAnalyzerCore.a
[160/492] Linking CXX static library lib/libclangStaticAnalyzerCheckers.a
[161/492] Linking CXX static library lib/libclangStaticAnalyzerFrontend.a
[162/492] Linking CXX static library lib/libclangFrontendTool.a
[163/492] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o
FAILED: lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /home/b/sanitizer-aarch64-linux/build/llvm_build0/bin/clang++ -DGTEST_HAS_RTTI=0 -DLLVM_EXPORTS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/b/sanitizer-aarch64-linux/build/build_default/lib/Target/Sparc -I/home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/lib/Target/Sparc -I/home/b/sanitizer-aarch64-linux/build/build_default/include -I/home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17 -fvisibility=hidden  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -MF lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o.d -o lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -c /home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp
/home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp:226:29: error: unused variable 'RegInfo' [-Werror,-Wunused-variable]
  226 |   const TargetRegisterInfo *RegInfo = MF.getSubtarget().getRegisterInfo();
      |                             ^~~~~~~
1 error generated.
[164/492] Building InstCombineTables.inc...
ninja: build stopped: subcommand failed.

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild
Step 15 (build standalone compiler-rt) failure: build standalone compiler-rt (failure)
...
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  CMakeLists.txt:12 (include)
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- The ASM compiler identification is unknown
-- Didn't find assembler
CMake Error at CMakeLists.txt:22 (project):
  The CMAKE_C_COMPILER:

    /home/b/sanitizer-aarch64-linux/build/build_default/bin/clang

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:22 (project):
  The CMAKE_CXX_COMPILER:

    /home/b/sanitizer-aarch64-linux/build/build_default/bin/clang++

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:22 (project):
  No CMAKE_ASM_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "ASM" or the CMake cache entry CMAKE_ASM_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.
-- Warning: Did not find file Compiler/-ASM
-- Configuring incomplete, errors occurred!

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild
ninja: Entering directory `compiler_rt_build'
ninja: error: loading 'build.ninja': No such file or directory

How to reproduce locally: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild

@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 3, 2024

LLVM Buildbot has detected a new failure on builder ppc64le-lld-multistage-test running on ppc64le-lld-multistage-test while building compiler-rt,llvm at step 12 "build-stage2-unified-tree".

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

Here is the relevant piece of the build log for the reference
Step 12 (build-stage2-unified-tree) failure: build (failure)
...
381.619 [1321/1154/3847] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Targets/XCore.cpp.o
381.651 [1320/1154/3848] Building CXX object lib/Target/MSP430/CMakeFiles/LLVMMSP430CodeGen.dir/MSP430TargetMachine.cpp.o
381.679 [1319/1154/3849] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcISelDAGToDAG.cpp.o
381.709 [1318/1154/3850] Building CXX object lib/Target/NVPTX/CMakeFiles/LLVMNVPTXCodeGen.dir/NVPTXImageOptimizer.cpp.o
381.739 [1317/1154/3851] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/FileManager.cpp.o
381.830 [1316/1154/3852] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/SourceMgrAdapter.cpp.o
381.938 [1315/1154/3853] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/DarwinSDKInfo.cpp.o
381.973 [1314/1154/3854] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonGenMemAbsolute.cpp.o
382.000 [1313/1154/3855] Building CXX object lib/Target/NVPTX/CMakeFiles/LLVMNVPTXCodeGen.dir/NVPTXCtorDtorLowering.cpp.o
382.033 [1312/1154/3856] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o
FAILED: lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o 
ccache /home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/install/stage1/bin/clang++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/build/stage2/lib/Target/Sparc -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/lib/Target/Sparc -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/build/stage2/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17 -fvisibility=hidden  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -MF lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o.d -o lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcFrameLowering.cpp.o -c /home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp
/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/lib/Target/Sparc/SparcFrameLowering.cpp:226:29: error: unused variable 'RegInfo' [-Werror,-Wunused-variable]
  226 |   const TargetRegisterInfo *RegInfo = MF.getSubtarget().getRegisterInfo();
      |                             ^~~~~~~
1 error generated.
382.149 [1312/1153/3857] Linking CXX static library lib/libLLVMXCoreDisassembler.a
382.210 [1312/1152/3858] Building CXX object lib/Target/Mips/Disassembler/CMakeFiles/LLVMMipsDisassembler.dir/MipsDisassembler.cpp.o
382.301 [1312/1151/3859] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/RDFCopy.cpp.o
382.320 [1312/1150/3860] Building CXX object lib/Target/NVPTX/CMakeFiles/LLVMNVPTXCodeGen.dir/NVPTXProxyRegErasure.cpp.o
382.341 [1312/1149/3861] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Targets/SystemZ.cpp.o
382.380 [1312/1148/3862] Building CXX object lib/Target/VE/MCTargetDesc/CMakeFiles/LLVMVEDesc.dir/VEMCCodeEmitter.cpp.o
382.434 [1312/1147/3863] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/HeaderSearch.cpp.o
382.461 [1312/1146/3864] Building CXX object lib/Target/LoongArch/CMakeFiles/LLVMLoongArchCodeGen.dir/LoongArchAsmPrinter.cpp.o
382.491 [1312/1145/3865] Building CXX object lib/Target/Mips/CMakeFiles/LLVMMipsCodeGen.dir/Mips16RegisterInfo.cpp.o
382.492 [1312/1144/3866] Building CXX object lib/Target/WebAssembly/CMakeFiles/LLVMWebAssemblyCodeGen.dir/WebAssemblyLowerRefTypesIntPtrConv.cpp.o
382.740 [1312/1143/3867] Building CXX object tools/clang/tools/diagtool/CMakeFiles/diagtool.dir/diagtool_main.cpp.o
382.771 [1312/1142/3868] Building CXX object tools/clang/lib/CodeGen/CMakeFiles/obj.clangCodeGen.dir/MacroPPCallbacks.cpp.o
382.791 [1312/1141/3869] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Targets/BPF.cpp.o
382.811 [1312/1140/3870] Building CXX object lib/Target/AVR/Disassembler/CMakeFiles/LLVMAVRDisassembler.dir/AVRDisassembler.cpp.o
382.812 [1312/1139/3871] Building CXX object lib/Target/WebAssembly/CMakeFiles/LLVMWebAssemblyCodeGen.dir/WebAssemblySetP2AlignOperands.cpp.o
382.828 [1312/1138/3872] Building CXX object lib/Target/Mips/CMakeFiles/LLVMMipsCodeGen.dir/MipsMulMulBugPass.cpp.o
383.021 [1312/1137/3873] Building CXX object lib/Target/XCore/CMakeFiles/LLVMXCoreCodeGen.dir/XCoreFrameToArgsOffsetElim.cpp.o
383.201 [1312/1136/3874] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/Preprocessor.cpp.o
383.261 [1312/1135/3875] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/PPMacroExpansion.cpp.o
383.351 [1312/1134/3876] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Targets/AVR.cpp.o
383.390 [1312/1133/3877] Building CXX object lib/Target/Sparc/CMakeFiles/LLVMSparcCodeGen.dir/SparcTargetMachine.cpp.o
383.411 [1312/1132/3878] Building CXX object lib/Target/XCore/CMakeFiles/LLVMXCoreCodeGen.dir/XCoreTargetObjectFile.cpp.o
383.561 [1312/1131/3879] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/Environment.cpp.o
383.895 [1312/1130/3880] Building CXX object lib/Target/AVR/CMakeFiles/LLVMAVRCodeGen.dir/AVRAsmPrinter.cpp.o
383.911 [1312/1129/3881] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/Refactoring.cpp.o
383.915 [1312/1128/3882] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/Iterator.cpp.o
383.990 [1312/1127/3883] Building CXX object tools/clang/tools/clang-installapi/CMakeFiles/clang-installapi.dir/clang-installapi-driver.cpp.o
384.030 [1312/1126/3884] Building CXX object lib/Target/MSP430/CMakeFiles/LLVMMSP430CodeGen.dir/MSP430ISelDAGToDAG.cpp.o
384.060 [1312/1125/3885] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonMachineScheduler.cpp.o
384.081 [1312/1124/3886] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Targets/AMDGPU.cpp.o
384.156 [1312/1123/3887] Building CXX object tools/clang/tools/amdgpu-arch/CMakeFiles/amdgpu-arch.dir/AMDGPUArchByHIP.cpp.o
384.166 [1312/1122/3888] Building CXX object lib/Target/BPF/CMakeFiles/LLVMBPFCodeGen.dir/BPFSubtarget.cpp.o
384.270 [1312/1121/3889] Building CXX object lib/Target/BPF/CMakeFiles/LLVMBPFCodeGen.dir/BPFMISimplifyPatchable.cpp.o

@koachan koachan deleted the sparc-dynamicstack branch November 3, 2024 16:36
rorth added a commit that referenced this pull request Nov 4, 2024
With PR #107223 and PR #107403, ASan testing can be enabled on SPARC.
This patch does so, 32-bit only on both Solaris and Linux. There is no
64-bit support even in GCC.

Apart from the obvious CMake changes, this patch includes a couple of
testcase adjustments necessary for SPARC:
- In `asan_oob_test.cpp`, the `OOB_int` subtest needs to be disabled: it
performs unaligned accesses that cannot work on a strict-alignment
target like SPARC.
- `asan_test.cpp` needs to disable subtests that depend on support for
`__builtin_setjmp` and `__builtin_longjmp`.
- `zero_page_pc.cpp` reports `0x5` as the faulting address on access to
`0x4`. I don't really know why, but it's consistent between Solaris and
Linux.

Tested on `sparcv9-sun-solaris2.11` and `sparc64-unknown-linux-gnu`.
PhilippRados pushed a commit to PhilippRados/llvm-project that referenced this pull request Nov 6, 2024
SPARC ABI doesn't use stack realignment, so let LLVM know about it in
`SparcFrameLowering`. This has the side effect of making all overaligned
allocations go through `LowerDYNAMIC_STACKALLOC`, so implement the
missing logic there too for overaligned allocations.
This makes the SPARC backend not crash on overaligned `alloca`s and fix
llvm#89569.
PhilippRados pushed a commit to PhilippRados/llvm-project that referenced this pull request Nov 6, 2024
With PR llvm#107223 and PR llvm#107403, ASan testing can be enabled on SPARC.
This patch does so, 32-bit only on both Solaris and Linux. There is no
64-bit support even in GCC.

Apart from the obvious CMake changes, this patch includes a couple of
testcase adjustments necessary for SPARC:
- In `asan_oob_test.cpp`, the `OOB_int` subtest needs to be disabled: it
performs unaligned accesses that cannot work on a strict-alignment
target like SPARC.
- `asan_test.cpp` needs to disable subtests that depend on support for
`__builtin_setjmp` and `__builtin_longjmp`.
- `zero_page_pc.cpp` reports `0x5` as the faulting address on access to
`0x4`. I don't really know why, but it's consistent between Solaris and
Linux.

Tested on `sparcv9-sun-solaris2.11` and `sparc64-unknown-linux-gnu`.
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.

llc crash when exec 'llc -mtriple=sparcel'
8 participants