https://gcc.gnu.org/g:2d18e65b09c735360f51339de8b4063835092577

commit 2d18e65b09c735360f51339de8b4063835092577
Author: Alexandre Oliva <[email protected]>
Date:   Fri Jan 16 19:22:15 2026 -0300

    testsuite: require c99_runtime for ldexp optimizations
    
    ldexpf and ldexpl are only optimized as expected when the target libc
    is known to have C99 support, so don't expect those optimizations when
    HAVE_C99_RUNTIME is not set by builtins-config.h.
    
    
    for  gcc/testsuite/ChangeLog
    
            * gcc.dg/tree-ssa/ldexp.c: Require HAVE_C99_RUNTIME to test
            ldexpf and ldexpl.

Diff:
---
 gcc/testsuite/gcc.dg/tree-ssa/ldexp.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldexp.c 
b/gcc/testsuite/gcc.dg/tree-ssa/ldexp.c
index 92bcf588b16a..ae555101c7e0 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ldexp.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ldexp.c
@@ -3,6 +3,8 @@
 
 /* { dg-final { scan-assembler-not "\tfmul\t" } } */
 
+#include "../builtins-config.h"
+
 #define TEST(TYPE, BUILTIN, CONST, NAME)                       \
   TYPE test_##NAME##_1(TYPE a, int i)                          \
   {                                                            \
@@ -28,5 +30,9 @@
   }
 
 TEST(double, ldexp, 8.0, double_ldexp)
+#if HAVE_C99_RUNTIME
+/* If libc is not known to have these functions, introduced in C99, the
+   compiler won't optimize them.  */
 TEST(float, ldexpf, 8.0f, float_ldexp)
 TEST(long double, ldexpl, 8.0L, long_ldexp)
+#endif

Reply via email to