On Wed, 30 Sep 2026, Jakub Jelinek wrote:

> Hi!
> 
> As I wrote earlier, I couldn't make
> On Tue, Sep 29, 2026 at 09:08:28AM +0200, Jakub Jelinek wrote:
> > --- a/gcc/testsuite/gcc.dg/pr127492.c       2026-09-22 14:58:11.232624179 
> > +0200
> > +++ b/gcc/testsuite/gcc.dg/pr127492.c       2026-09-29 08:51:56.240821492 
> > +0200
> > @@ -1,5 +1,5 @@
> >  /* PR middle-end/127492 */
> > -/* { dg-do run } */
> > +/* { dg-do run { target { { { int128 && sync_int_128_runtime } || { { ! 
> > int128 } && sync_long_long_runtime } } || libatomic_available } } } */
> >  /* { dg-options "-O2" } */
> >  /* { dg-additional-options "-latomic" { target libatomic_available } } */
> to work, dunno if multiple occurrences of the same effective target
> once not negated and once negated don't cause it.
> 
> So, here is a patch which splits the test into two, one tests just
> __int128 atomics, one tests long long atomics, on lp64 targets
> we can test both.
> And the effective targets are so that either the target has hw
> support of the atomics with no need of -latomic, or -latomic is available.
> 
> Tested on x86_64-linux -m32/-m64, also verified that the test PASS or are
> UNSUPPORTED as expected if I replace the sync_int_128_runtime,
> sync_long_long_runtime and/or libatomic_available one at a time by other
> effective targets.  Ok for trunk?

OK.

> 2026-09-30  Jakub Jelinek  <[email protected]>
> 
>       PR middle-end/127492
>       * gcc.dg/pr127492.c: Require int128 effective target and either
>       sync_int_128_runtime or libatomic_available.  Drop the long long
>       fallback, but define T only if it is not defined already.
>       * gcc.dg/pr127492-2.c: New test.
> 
> --- a/gcc/testsuite/gcc.dg/pr127492.c 2026-09-30 09:29:19.123195696 +0200
> +++ b/gcc/testsuite/gcc.dg/pr127492.c 2026-09-30 09:28:43.610671123 +0200
> @@ -1,12 +1,10 @@
>  /* PR middle-end/127492 */
> -/* { dg-do run } */
> +/* { dg-do run { target { int128 && { sync_int_128_runtime || 
> libatomic_available } } } } */
>  /* { dg-options "-O2" } */
>  /* { dg-additional-options "-latomic" { target libatomic_available } } */
>  
> -#ifdef __SIZEOF_INT128__
> +#ifndef T
>  #define T __int128
> -#else
> -#define T long long
>  #endif
>  T v = 1;
>  
> --- a/gcc/testsuite/gcc.dg/pr127492-2.c       2026-09-30 09:29:36.191967187 
> +0200
> +++ b/gcc/testsuite/gcc.dg/pr127492-2.c       2026-09-30 09:39:25.474082213 
> +0200
> @@ -0,0 +1,7 @@
> +/* PR middle-end/127492 */
> +/* { dg-do run { target { sync_long_long_runtime || libatomic_available } } 
> } */
> +/* { dg-options "-O2" } */
> +/* { dg-additional-options "-latomic" { target libatomic_available } } */
> +
> +#define T long long
> +#include "pr127492.c"
> 
> 
>       Jakub
> 
> 

-- 
Richard Biener <[email protected]>
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Stefan Gaiser, Jochen Jaser, Abhinav Puri; (HRB 36809, AG Nuernberg)

Reply via email to