toolchain
toolchain copied to clipboard
ARC64: fp-int-convert-timode-* fails in Linux
Investigate why they are failing:
FAIL: gcc.dg/torture/fp-int-convert-timode-3.c -O0 execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-3.c -O1 execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-3.c -O2 execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-3.c -O3 -g execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-3.c -Os execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-3.c -O2 -flto -fno-use-linker-plugin -flto-partition=none execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-3.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-4.c -O0 execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-4.c -O1 execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-4.c -O2 execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-4.c -O3 -g execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-4.c -Os execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-4.c -O2 -flto -fno-use-linker-plugin -flto-partition=none execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-4.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects execution test
It seems the fesetround
is not implemented. This is what the compiler is showing:
fp-int-convert-timode-3.c:(.text+0x68): warning: fesetround is not implemented and will always fail
The linker warning is benign - for soft-float builds we always get them (even in ARCv2) and still have no extraneous failures in ARCv2 or ARCv3. You need to triage the real problem.
Without a proper implementation of fesetround
the tests are bound to fail. Moreover, the tests are also failing whenever we relay on soft-fp implementation, regardless if fesetround
is implemented.
Without a proper implementation of
fesetround
the tests are bound to fail. Moreover, the tests are also failing whenever we relay on soft-fp implementation, regardless iffesetround
is implemented.
glibc soft-fp only implements FE_TONEAREST. And since the test uses FE_UPWARD it is bound to fail. The reason it doesn't fail for ARCv2 is int128 is not supported so the test is not even build there. These need to be marked XFAIL for soft-fp (I'm surprised they are not already)
int
__fesetround (int round)
{
#ifdef FE_TONEAREST
return (round == FE_TONEAREST) ? 0 : 1;
#else
return 1; /* Signal we are unable to set the direction. */
#endif
}
With my glibc hard-float build, it seems to be hitting abort() due to conversion failures: this needs investigation whether gcc is generating the right 128-bit conversion etc.
float fs = s128; if (fs != -0x1.fffffep+126) abort (); double ds = s128; if (ds != -0x1.fffffffffffffp+126) abort ();
I suppose the conversion still relay on soft implementation. Hence, the error.
These tests are now stated as UNSUPPORTED.
These tests were modified to require the use of hard floating point
, as shown in:
commit ff01849dccd4355ac6491c04eff8b2e39ecee70e
Author: Vineet Gupta <[email protected]>
Date: Sun Jun 26 15:03:52 2022 -0400
[PATCH] testsuite: constraint some of fp tests to hard_float
These tests validate fp conversions with various rounding modes which
would not work on soft-float ABIs.
On -march=rv64imac/-mabi=lp64 this reduces 5 unique failures (overall 35
due to multi flag combination builds)
gcc/testsuite/Changelog:
* gcc.dg/torture/fp-double-convert-float-1.c: Add
dg-require-effective-target hard_float.
* gcc.dg/torture/fp-int-convert-timode-3.c: Ditto.
* gcc.dg/torture/fp-int-convert-timode-4.c: Ditto.
* gcc.dg/torture/fp-uint64-convert-double-1.c: Ditto.
* gcc.dg/torture/fp-uint64-convert-double-2.c: Ditto.
However, since this feature is not implemented yet, it has led to the UNSUPPORTED output in the new dejagnu result:
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-3.c -O0
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-3.c -O1
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-3.c -O2
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-3.c -O3 -g
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-3.c -Os
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-3.c -O2 -flto -fno-use-linker-plugin -flto-partition=none
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-3.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-4.c -O0
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-4.c -O1
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-4.c -O2
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-4.c -O3 -g
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-4.c -Os
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-4.c -O2 -flto -fno-use-linker-plugin -flto-partition=none
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-4.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects