[libc-commits] [libc] 5f47fee - [NFC][libc] Clean up unsequenced access warning (#232043)

via libc-commits libc-commits at lists.llvm.org
Sat Oct 17 03:00:04 PDT 2026


Author: Nikita Terentev
Date: 2026-10-17T05:59:59-04:00
New Revision: 5f47feeedda059f88c30ca6f11109faa5ce5428c

URL: https://github.com/llvm/llvm-project/commit/5f47feeedda059f88c30ca6f11109faa5ce5428c
DIFF: https://github.com/llvm/llvm-project/commit/5f47feeedda059f88c30ca6f11109faa5ce5428c.diff

LOG: [NFC][libc] Clean up unsequenced access warning (#232043)

Close #217998.

---------

Co-authored-by: root <root at Best-Komp.localdomain>

Added: 
    

Modified: 
    libc/src/__support/math/log1p.h

Removed: 
    


################################################################################
diff  --git a/libc/src/__support/math/log1p.h b/libc/src/__support/math/log1p.h
index f41d1cc9c0521f..7dd7c66802c837 100644
--- a/libc/src/__support/math/log1p.h
+++ b/libc/src/__support/math/log1p.h
@@ -942,10 +942,14 @@ LIBC_INLINE double log1p(double x) {
       if (x + x == 0.0)
         return x + x; // Handle FTZ/DAZ correctly.
 
-      volatile float tp = 1.0f;
-      volatile float tn = -1.0f;
-      bool rdp = (tp - 0x1p-25f != tp);
-      bool rdn = (tn - 0x1p-24f != tn);
+      volatile float tpv = 1.0f;
+      volatile float tnv = -1.0f;
+
+      float tp = tpv - 0x1p-25f;
+      float tn = tnv - 0x1p-25f;
+
+      bool rdp = (tp != tpv);
+      bool rdn = (tn != tnv);
 
       if (x > 0 && rdp) {
         return FPBits_t(x_u - 1).get_val();


        


More information about the libc-commits mailing list