GCC has built in function[1] for those math function stuff, e.g. __builtin_ceilf, so we don't really need math.h :)
[1] https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html On Thu, Sep 21, 2023 at 11:20 AM Palmer Dabbelt <pal...@rivosinc.com> wrote: > > On Wed, 20 Sep 2023 10:47:23 PDT (-0700), Patrick O'Neill wrote: > > Juzhe, > > > > On a more general note, are we expecting #include <math.h> to cause a > > testcase to fail? > > > > My motivation is to make the testsuite less noisy when checking for > > regressions. For example, a patch like this one: > > https://patchwork.sourceware.org/project/gcc/patch/20230920023059.1728132-1-pan2...@intel.com/ > > is showing 4 new failures on rv32gcv from the {dg-do compile} testcases > > that #include <math.h>. I might be wrong, but those don't look like real > > failures to me [1][2][3]. > > > > On glibc rv64gcv I'm seeing tests like: > > gcc.target/riscv/rvv/autovec/unop/vnot-rv32gcv.c > > fail with similar missing stubs-ilp32d.h errors. > > > > I want to sanity-check with other people that they are seeing similar > > errors and that these errors indicate something wrong with the testsuite. > > If nobody else is seeing these errors, I'd like to hear how you're > > running the testsuite so I can debug the riscv-gnu-toolchain repo. > > > > Patrick > > > > [1]: > > Executing on host: > > /github/ewlu-runner-2/_work/riscv-gnu-toolchain/riscv-gnu-toolchain/build/build-gcc-linux-stage2/gcc/xgcc > > -B/github/ewlu-runner-2/_work/riscv-gnu-toolchain/riscv-gnu-toolchain/build/build-gcc-linux-stage2/gcc/ > > /github/ewlu-runner-2/_work/riscv-gnu-toolchain/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/math-ceil-1.c > > -march=rv32gcv -mabi=ilp32d -mcmodel=medlow -fdiagnostics-plain-output > > -O3 -ftree-vectorize -march=rv64gcv -mabi=lp64d -O3 -ftree-vectorize > > -fno-vect-cost-model -ffast-math -fno-schedule-insns > > -fno-schedule-insns2 -S -o math-ceil-1.s (timeout = 600) > > spawn -ignore SIGHUP > > /github/ewlu-runner-2/_work/riscv-gnu-toolchain/riscv-gnu-toolchain/build/build-gcc-linux-stage2/gcc/xgcc > > -B/github/ewlu-runner-2/_work/riscv-gnu-toolchain/riscv-gnu-toolchain/build/build-gcc-linux-stage2/gcc/ > > /github/ewlu-runner-2/_work/riscv-gnu-toolchain/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/math-ceil-1.c > > -march=rv32gcv -mabi=ilp32d -mcmodel=medlow -fdiagnostics-plain-output > > -O3 -ftree-vectorize -march=rv64gcv -mabi=lp64d -O3 -ftree-vectorize > > -fno-vect-cost-model -ffast-math -fno-schedule-insns > > -fno-schedule-insns2 -S -o math-ceil-1.s > > In file included from > > /github/ewlu-runner-2/_work/riscv-gnu-toolchain/riscv-gnu-toolchain/build/sysroot/usr/include/features.h:515, > > from > > /github/ewlu-runner-2/_work/riscv-gnu-toolchain/riscv-gnu-toolchain/build/sysroot/usr/include/bits/libc-header-start.h:33, > > from > > /github/ewlu-runner-2/_work/riscv-gnu-toolchain/riscv-gnu-toolchain/build/sysroot/usr/include/math.h:27, > > from > > /github/ewlu-runner-2/_work/riscv-gnu-toolchain/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/test-math.h:1, > > from > > /github/ewlu-runner-2/_work/riscv-gnu-toolchain/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/math-ceil-1.c:5: > > /github/ewlu-runner-2/_work/riscv-gnu-toolchain/riscv-gnu-toolchain/build/sysroot/usr/include/gnu/stubs.h:17:11: > > fatal error: gnu/stubs-lp64d.h: No such file or directory > > That looks like a toolchain build/configuration issue, not a test issue. > IIRC this comes up from time to time, something's probably broken in > riscv-gnu-toolchain but I'm not sure what's wrong. > > I get a working setup with just `./configure --enable-linux > --disable-multilib` and the latest riscv-gnu-toolchain master. How are > you building things? > > > compilation terminated. > > compiler exited with status 1 > > FAIL: gcc.target/riscv/rvv/autovec/math-ceil-1.c -O3 -ftree-vectorize > > (test for excess errors) > > > > [2]: > > https://github.com/ewlu/riscv-gnu-toolchain/issues/170 > > > > [3]: > > This also extends beyond math.h. I'm seeing similar failures for > > testcases like > > gcc.target/riscv/rvv/autovec/cond/cond_convert_int2float-rv64-1.c that > > #include <stdint.h>. > > > > > > On 9/19/23 18:12, Patrick O'Neill wrote: > >> > >> I'll let it run overnight and see if this helps. Even before this patch, > >> I was seeing 233 stubs related failures for rv32gcv and 7 for rv64gcv so > >> this won't fix all the issues. > >> > >> It's easily replicated using upstream riscv-gnu-toolchain > >> git clone https://github.com/riscv-collab/riscv-gnu-toolchain > >> cd riscv-gnu-toolchain > >> git submodule update --init gcc > >> cd gcc > >> git pull master > >> cd .. > >> mkdir build > >> cd build > >> ../configure --prefix=$(pwd) --with-arch=rv32gcv --with-abi=ilp32d > >> make report-linux -j32 > >> > >> Then search for "stubs" in the debug logs > >> (/build-gcc-linux-stage2/gcc/testsuite/*.log) > >> > >> Patrick > >> > >> On 9/19/23 17:54, juzhe.zh...@rivai.ai wrote: > >>> I think we could remove match.h. > >>> > >>> Hi, @Patrick. Could you verify it? > >>> > >>> diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/def.h > >>> b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/def.h > >>> index 2292372d7a3..674098e9ba6 100644 > >>> --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/def.h > >>> +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/def.h > >>> @@ -1,5 +1,4 @@ > >>> #include <stdint-gcc.h> > >>> -#include <math.h> > >>> > >>> and commit it. > >>> > >>> Thanks. > >>> ------------------------------------------------------------------------