Misc: fixed strict aliasing violation in ImHashData() affecting Clang 23 + SSE 4.2 + -flto. (#9557, #9560)
diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt
index e751035..1eee0b7 100644
--- a/docs/CHANGELOG.txt
+++ b/docs/CHANGELOG.txt
@@ -114,6 +114,9 @@
     trivial functions when stepping into.
   - Tagged various trivial functions using `IM_NODEBUGSTEP`: `ImVec2()`, `ImVec4()` etc.
     and various operators.
+  - Fixed strict aliasing violation in `ImHashData()` affecting Clang 23 + SSE 4.2 + -flto.
+    Could manifest as `ImFontAtlasBakedGetId()` computation omitting font size from
+    the hashed data. (#9557, #9560) [@sthalik]
   - IO: restore default clipboard/ime/shell platform handlers on ClearPlatformHandlers(), fixing
     issues switching backends mid-session to one relying on default. (#9537, #8945, #2769) [@lstalmir]
 - DrawList:
diff --git a/imgui.cpp b/imgui.cpp
index 57ed579..fb86370 100644
--- a/imgui.cpp
+++ b/imgui.cpp
@@ -2493,7 +2493,13 @@
 #else
     while (data + 4 <= data_end)
     {
+#if defined(_DEBUG) || defined(_MSC_VER)
         crc = _mm_crc32_u32(crc, *(ImU32*)data);
+#else
+        ImU32 v;
+        memcpy(&v, data, sizeof(ImU32)); // Avoid aliasing violation (#9557)
+        crc = _mm_crc32_u32(crc, v); 
+#endif
         data += 4;
     }
     while (data < data_end)