Re: [PATCH] testsuite: Fix up gcc.dg/torture/bitint-100.c test [PR124948]
Andrea Pinski <[email protected]> Tue, 4 Aug 2026 08:58:00 -0700
| Newsgroups | gmane.comp.gcc.patches |
|---|---|
| Message-ID | <CALvbMcB2X1-4c7v1WWnEF6WOpKx3iBGK-wECdkzQ24W=ibCH-A@mail.gmail.com> |
On Tue, Aug 4, 2026 at 8:54=E2=80=AFAM Jakub Jelinek <[email protected]> wro= te: > > On Mon, Aug 03, 2026 at 01:56:35PM +0200, Torbjorn SVENSSON wrote: > > On 2026-08-03 13:54, Jakub Jelinek wrote: > > > On Mon, Aug 03, 2026 at 01:50:18PM +0200, Torbjorn SVENSSON wrote: > > > > This change introduces new failures for arm-none-eabi using thumb/a= rch=3Darmv6s-m/cpu=3Dcortex-m0/float-abi=3Dsoft/fpu=3Dauto. > > > > > > > > Testing torture/bitint-100.c, -O0 > > > > doing compile > > > > Executing on host: /build/install-native/bin/arm-none-eabi-gcc /bu= ild/gcc_src/gcc/testsuite/gcc.dg/torture/bitint-100.c -mthumb -march=3Darm= v6s-m -mcpu=3Dcortex-m0 -mfloat-abi=3Dsoft -mfpu=3Dauto -dumpbase "" -fdi= agnostics-plain-output -O0 -std=3Dc23 -pedantic-errors --specs=3Dr= dimon.specs -Wl,--start-group -lc -lm -Wl,--end-group --specs=3Dnosys.specs= -Wl,--allow-multiple-definition -Wl,-u,_isatty,-u,_fstat -Wl,-wrap,exit -= Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort -Wl,gcc_tg.o -lm -T qemu.ld -= o ./bitint-100.exe (timeout =3D 800) > > > > spawn -ignore SIGHUP /build/install-native/bin/arm-none-eabi-gcc /b= uild/gcc_src/gcc/testsuite/gcc.dg/torture/bitint-100.c -mthumb -march=3Darm= v6s-m -mcpu=3Dcortex-m0 -mfloat-abi=3Dsoft -mfpu=3Dauto -dumpbase -fdiagno= stics-plain-output -O0 -std=3Dc23 -pedantic-errors --specs=3Drdimon.specs -= Wl,--start-group -lc -lm -Wl,--end-group --specs=3Dnosys.specs -Wl,--allow-= multiple-definition -Wl,-u,_isatty,-u,_fstat -Wl,-wrap,exit -Wl,-wrap,_exit= -Wl,-wrap,main -Wl,-wrap,abort -Wl,gcc_tg.o -lm -T qemu.ld -o ./bitint-100= .exe > > > > pid is 1478576 -1478576 > > > > /build/install-native/arm-none-eabi/bin/ld: /tmp/ccgSaSgH.o: in fun= ction `f1': > > > > bitint-100.c:(.text+0x5a): undefined reference to `__atomic_compare= _exchange_4' > > > > /build/install-native/arm-none-eabi/bin/ld: (__atomic_compare_excha= nge_4): Unknown destination type (ARM/Thumb) in /tmp/ccgSaSgH.o > > > > bitint-100.c:(.text+0x5a): dangerous relocation: unsupported reloca= tion > > > > /build/install-native/arm-none-eabi/bin/ld: /tmp/ccgSaSgH.o: in fun= ction `f2': > > > > bitint-100.c:(.text+0xa4): undefined reference to `__atomic_compare= _exchange_4' > > > > /build/install-native/arm-none-eabi/bin/ld: (__atomic_compare_excha= nge_4): Unknown destination type (ARM/Thumb) in /tmp/ccgSaSgH.o > > > > bitint-100.c:(.text+0xa4): dangerous relocation: unsupported reloca= tion > > > > ... > > > > collect2: error: ld returned 1 exit status > > > > status 1 > > > > compiler exited with status 1 > > > > FAIL: gcc.dg/torture/bitint-100.c -O0 (test for excess errors) > > > > > > > > Same failure exist on both trunk and releases/gcc-16. > > > > > > I thought gcc has been changed to add -latomic_asneeded by default. > > > Or is this because the linker doesn't support it in this configuratio= n? > > To my knowledge, there is no atomic support for armv6s-m, but I can be = wrong. > > Most of the tests that are dg-do run and use atomics on int/long use > sync_int_long effective target. Atomics on _BitInt(17), i.e. something > on all currently supported targets larger than short, probably need to be > treated the same. > > Tested on x86_64-linux, ok for trunk? Ok. > > 2026-08-04 Jakub Jelinek <[email protected]> > > PR target/124948 > * gcc.dg/torture/bitint-100.c: Require also sync_int_long effecti= ve > target. > > --- gcc/testsuite/gcc.dg/torture/bitint-100.c.jj 2026-07-14 10:43:= 39.057947557 +0200 > +++ gcc/testsuite/gcc.dg/torture/bitint-100.c 2026-08-04 17:43:31.93719= 3354 +0200 > @@ -1,5 +1,5 @@ > /* PR target/124948 */ > -/* { dg-do run { target bitint } } */ > +/* { dg-do run { target { bitint && sync_int_long } } } */ > /* { dg-options "-std=3Dc23 -pedantic-errors" } */ > /* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O0" "-O2" } } = */ > /* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */ > > > Jakub >