https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127435

            Bug ID: 127435
           Summary: jit.dg/test-sized-float.c fails to compile on some
                    targets due to unconditional use of __float128
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: jit
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: dmalcolm at gcc dot gnu.org
                CC: antoyo at gcc dot gnu.org
  Target Milestone: ---

Target: aarch64, s390x, ppc64le (all non-x86_64)
Component: jit

Test output:
FAIL: jit.dg/test-sized-float.c, initial compilation

Compile errors:
test-sized-float.c:14:3: error: unknown type name '__float128'; did you mean
'_Float128'?
test-sized-float.c:157:33: error: '__float128' undeclared (first use in this
function); did you mean '_Float128'?

Claude code generated this analysis for me, which seems correct:
BEGIN QUOTE
Introducing commit: r16-4546 (Antoni Boucher, 2025-09-19, "libgccjit: Add
_Float16, _Float32, _Float64 and __float128 support for jit"). No subsequent
commits have touched this test file.

The test's JIT code in create_code() correctly gates float128 usage via
gcc_jit_target_info_supports_target_dependent_type(target_info,
GCC_JIT_TYPE_FLOAT128). However, the C harness code uses __float128
unconditionally in three places: the struct float_zoo definition (line 14), and
in verify_code() (lines 157, 166). __float128 is a GCC extension type available
only on x86_64 (plus IA-64, PowerPC with VSX, LoongArch, HPPA). On
aarch64/s390x, where IEEE binary128 is supported as _Float128 (not __float128),
the test fails to compile.

The fix is to replace __float128 with _Float128 in the C harness code (lines
14, 157, 166). _Float128 (ISO C2x / TS 18661-3) is available on all targets
that support IEEE binary128, including aarch64 and s390x where __float128 is
not. An additional #ifdef guard (e.g. __FLT128_MAX__) may be prudent for
targets that support neither spelling.
END QUOTE

Reply via email to