https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115826
Bug ID: 115826
Summary: vect-tsvc-s1281.c fails with with -ffast-math on
arm-none-eabi
Product: gcc
Version: 13.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: testsuite
Assignee: unassigned at gcc dot gnu.org
Reporter: azoff at gcc dot gnu.org
Target Milestone: ---
When running tests on arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi with
"-mthumb -march=armv7ve -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon", I see the
following failure in the log:
Testing tsvc/vect-tsvc-s1281.c
doing compile
Executing on host:
/build/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gcc
/src/gcc/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s1281.c -mthumb
-march=armv7ve -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon -dumpbase ""
-fdiagnostics-plain-output -ffast-math -ftree-vectorize
-fno-tree-loop-distribute-patterns -fno-vect-cost-model -fno-common -O2
-fdump-tree-vect-details --param vect-epilogues-nomask=0 -Wl,--start-group
-lc -lm -Wl,--end-group --specs=nosys.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 -o ./vect-tsvc-s1281.exe (timeout = 800)
spawn -ignore SIGHUP
/build/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gcc
/src/gcc/gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s1281.c -mthumb
-march=armv7ve -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon -dumpbase ""
-fdiagnostics-plain-output -ffast-math -ftree-vectorize
-fno-tree-loop-distribute-patterns -fno-vect-cost-model -fno-common -O2
-fdump-tree-vect-details --param vect-epilogues-nomask=0 -Wl,--start-group
-lc -lm -Wl,--end-group --specs=nosys.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 -o ./vect-tsvc-s1281.exe
pid is 479 -479
pid is -1
output is status 0
PASS: gcc.dg/vect/tsvc/vect-tsvc-s1281.c (test for excess errors)
spawning command qemu-system-arm -nographic -machine virt -cpu cortex-a7 -m
256 -semihosting -monitor /dev/null -kernel ./vect-tsvc-s1281.exe
spawn qemu-system-arm -nographic -machine virt -cpu cortex-a7 -m 256
-semihosting -monitor /dev/null -kernel ./vect-tsvc-s1281.exe
value: inf, expected: inf
*** EXIT code 4242
*** EXIT code 1
pid is -1
Shell closed.
Output is value: inf, expected: inf
*** EXIT code 4242
*** EXIT code 1
As can be seen, the testcase is trying to do inf checks with the -ffast-math
witch is not supported.
The -fast-math comes from below block of check_vect_support_and_set_flags in
gcc/testsuite/lib/target-supports.exp:
} elseif [is-effective-target arm_neon_ok] {
eval lappend DEFAULT_VECTCFLAGS [add_options_for_arm_neon ""]
# NEON does not support denormals, so is not used for vectorization by
# default to avoid loss of precision. We must pass -ffast-math to test
# vectorization of float operations.
lappend DEFAULT_VECTCFLAGS "-ffast-math"
if [is-effective-target arm_neon_hw] {
set dg-do-what-default run
} else {
set dg-do-what-default compile
}
>From what understand, the -ffast-match is required for other testcases, so the
removal of it from DEFAULT_VECTCFLAGS is not an option.
The vect-tsvc-s1281.c testcase assumes that comparison with INF is possible,
but it's not and the compiler will simply remove the checks as they were never
there.
Should the vect-tsvc-s1281.c testcase be disabled for Arm based targets? Or is
there any alternative that would not have this fail?
The failure of vect-tsvc-s1281.c was introduced in
basepoints/gcc-13-2810-gb7fd7fb5011.