Re: [PATCH] testsuite: Fix up gcc.dg/pr126464.c test [PR126464]

Andrea Pinski <[email protected]> Tue, 4 Aug 2026 08:38:07 -0700
Newsgroups gmane.comp.gcc.patches
Message-ID <CALvbMcApv_a8aChqoQNZV2YzweKKW8qXYgR0Ep7P=VgrDMm=hg@mail.gmail.com>
On Tue, Aug 4, 2026 at 8:35=E2=80=AFAM Jakub Jelinek <[email protected]> wro=
te:
>
> On Tue, Aug 04, 2026 at 02:13:19PM +0200, Torbjorn SVENSSON wrote:
> > This causes regression on most (all?) arm-none-eabi targets.
> > /build/gcc_src/gcc/testsuite/gcc.dg/pr126464.c:56:3: warning: floating =
constant exceeds range of 'long double' [-Woverflow]
>
> This patch guards it with preprocessor tests whether such floating point
> constants are representable.
>
> Tested on x86_64-linux, ok for trunk?
Ok.

>
> 2026-08-04  Jakub Jelinek  <[email protected]>
>
>         PR tree-optimization/126464
>         * gcc.dg/pr126464.c: Guard uses of 1e300 with
>         __DBL_MAX_10_EXP__ >=3D 301 and uses of 1e4000L with
>         __LDBL_MAX_10_EXP__ >=3D 4001.
>
> --- gcc/testsuite/gcc.dg/pr126464.c.jj  2026-07-30 09:56:33.400729346 +02=
00
> +++ gcc/testsuite/gcc.dg/pr126464.c     2026-08-04 17:31:18.458149999 +02=
00
> @@ -47,15 +47,19 @@ qux (long double x)
>  int
>  main ()
>  {
> +#if __DBL_MAX_10_EXP__ >=3D 301
>    if (!__builtin_isinf ((double) 1e300)
>        && __builtin_isinf ((float) 1e300)
>        && (foo (-1e300) !=3D -5e299
>           || baz (1e300) !=3D 5e299))
>      __builtin_abort ();
> +#endif
>
> +#if __LDBL_MAX_10_EXP__ >=3D 4001
>    if (!__builtin_isinf ((long double) 1e4000L)
>        && __builtin_isinf ((double) 1e4000L)
>        && (bar (1e4000L) !=3D 5e3999L
>           || qux (-1e4000L) !=3D -5e3999L))
>      __builtin_abort ();
> +#endif
>  }
>
>
>         Jakub
>