Fix missing LR + FP stacking when using asserts
diff --git a/components/include/memfault/panics/fault_handling.h b/components/include/memfault/panics/fault_handling.h
index a79a15a..0a154cb 100644
--- a/components/include/memfault/panics/fault_handling.h
+++ b/components/include/memfault/panics/fault_handling.h
@@ -82,9 +82,9 @@
 //! @param lr The return address
 //! @see MEMFAULT_ASSERT_RECORD
 //! @see MEMFAULT_ASSERT
-#if defined(__CC_ARM) || defined(__ICCARM__) || (defined(__clang__) && defined(__ti__))
-//! ARMCC, IAR, and tiarmclang will optimize away link register stores from callsites which makes it
-//! impossible for a reliable backtrace to be resolved so we don't use the NORETURN attribute
+#if defined(__CC_ARM) || defined(__ICCARM__) || defined(__clang__)
+//! ARMCC, IAR, clang, and tiarmclang optimize away link register stores from callsites which makes
+//! it impossible for a reliable backtrace to be resolved so we don't use the NORETURN attribute
 #else
 MEMFAULT_NORETURN
 #endif
@@ -97,9 +97,9 @@
 //! @param extra_info Additional information used by the assert handler
 //! @see MEMFAULT_ASSERT_RECORD
 //! @see MEMFAULT_ASSERT
-#if defined(__CC_ARM) || defined(__ICCARM__) || (defined(__clang__) && defined(__ti__))
-//! ARMCC, IAR, and tiarmclang optimize away link register stores from callsites which makes it
-//! impossible for a reliable backtrace to be resolved so we don't use the NORETURN attribute
+#if defined(__CC_ARM) || defined(__ICCARM__) || defined(__clang__)
+//! ARMCC, IAR, clang, and tiarmclang optimize away link register stores from callsites which makes
+//! it impossible for a reliable backtrace to be resolved so we don't use the NORETURN attribute
 #else
 MEMFAULT_NORETURN
 #endif
diff --git a/components/panics/src/memfault_fault_handling_arm.c b/components/panics/src/memfault_fault_handling_arm.c
index 0e3163a..2868870 100644
--- a/components/panics/src/memfault_fault_handling_arm.c
+++ b/components/panics/src/memfault_fault_handling_arm.c
@@ -554,7 +554,13 @@
     #define MEMFAULT_ASSERT_TRAP() __asm volatile("udf #77")
   #endif
 
-static void prv_fault_handling_assert(void *pc, void *lr, eMemfaultRebootReason reason) {
+  #if defined(__clang__)
+// When using clang with LTO, the compiler can optimize storing the LR + FP from this function,
+// disable optimizations to fix
+MEMFAULT_NO_OPT
+  #endif
+static void
+prv_fault_handling_assert(void *pc, void *lr, eMemfaultRebootReason reason) {
   // Only set the crash reason if it's unset, in case we are in a nested assert
   if (s_crash_reason == kMfltRebootReason_Unknown) {
     sMfltRebootTrackingRegInfo info = {
diff --git a/components/panics/src/memfault_stdlib_assert.c b/components/panics/src/memfault_stdlib_assert.c
index 742abd4..df368a2 100644
--- a/components/panics/src/memfault_stdlib_assert.c
+++ b/components/panics/src/memfault_stdlib_assert.c
@@ -24,6 +24,10 @@
   (void)file, (void)line, (void)func, (void)failedexpr;
   #endif
   MEMFAULT_ASSERT(0);
+
+  #if defined(__clang__)
+  MEMFAULT_UNREACHABLE;
+  #endif
 }
 
 #endif  // MEMFAULT_ASSERT_CSTDLIB_HOOK_ENABLED && !defined(__TI_ARM__)