On Wed, Apr 23, 2025 at 04:46:04PM +0100, Andre Vieira (lists) wrote: > On 23/04/2025 16:22, Jakub Jelinek wrote: > > On Wed, Apr 23, 2025 at 03:57:58PM +0100, Andre Vieira (lists) wrote: > > > +++ b/gcc/testsuite/gcc.target/aarch64/pr116479.c > > > @@ -0,0 +1,20 @@ > > > +/* PR 116479 */ > > > +/* { dg-do run } */ > > > +/* { dg-additional-options "-O -funroll-loops -finline-stringops > > > -fmodulo-sched --param=max-iterations-computation-cost=637924687 -static > > > -std=c23" } */ > > > +_BitInt (13577) b; > > > + > > > +void > > > +foo (char *ret) > > > +{ > > > + __builtin_memset (&b, 4, 697); > > > + *ret = 0; > > > +} > > > + > > > +int > > > +main () > > > +{ > > > + char x; > > > + foo (&x); > > > + for (unsigned i = 0; i < sizeof (x); i++) > > > + __builtin_printf ("%02x", i[(volatile unsigned char *) &x]); > > > > Shouldn't these 2 lines instead be > > if (x != 0) > > __builtin_abort (); > > ? > > > > Fair, I copied the testcase verbatim from the PR, the error-mode was a > segfault. But I agree a check !=0 with __builtin_abort here seems more > appropriate. Any opinions on whether I should move it to dg with a bitint > target?
I think there isn't anything aarch64 specific on the test, so yes, I'd move it to gcc/testsuite/gcc.dg/bitint-123.c, /* { dg-do run { target bitint } } */ and wrap b/foo definitions into #if __BITINT_MAXWIDTH__ >= 13577 and the main body as well (just in case some target supports smaller maximum width than that). Also, drop -static from dg-additional-options? Jakub