On Wed, Oct 3, 2018 at 11:37 AM Jim Wilson <j...@sifive.com> wrote: > Thanks. I see that the rs6000.md port has a pattern that checks > HONOR_SNANS which looks like the right way to solve this problem. I > will try modifying Andrew's patch to use that and check against the > glibc testsuite.
With a modified version of Andrew's patch, the testcase in Kito's patch works, and I see the glibc testsuite failures drop from 151 to 131, so there is still something wrong. Last time I ran the glibc testsuite we were around 50-60 failures without Andrew's patch, so either something broke, or there are more glibc tests than before. I suspect we need another related gcc change as most of the failures are FP related. I'll try to pull out another testcase, and if it isn't a bug in my current patch then I will push it and work on another one for the new problem. FYI, some of the failures could be due to a suspected kernel bug. I've noticed some gcc testsuite failures are due to the fact that the fenv flags aren't clear at program startup. But the weird thing is that the testcases fail when run from the shell, but work when run from inside gdb, which makes it difficult to debug, and makes me suspect a kernel bug. fedora-riscv:1010$ cat tmp.c #include <fenv.h> #include <stdlib.h> int main (void) { if (fetestexcept (FE_INEXACT)) abort (); return 0; } fedora-riscv:1011$ gcc tmp.c -lm fedora-riscv:1012$ ./a.out Aborted (core dumped) fedora-riscv:1013$ It also fails if I put the test in a constructor, so the problem happens before _start is called. It also fails if static linked, so it doesn't appear to be a dynamic linker problem either. I've tried looking at the kernel support for FP regs, but I'm not a kernel expert, so I haven't made any progress there. Jim