On 11/13/24 9:50 AM, Dimitar Dimitrov wrote:
When configuring GCC for RV32EC with:
   ./configure                                     \
       --target=riscv32-none-elf                   \
       --with-multilib-generator="rv32ec-ilp32e--" \
       --with-abi=ilp32e                           \
       --with-arch=rv32ec

Then the build fails because division is erroneously left enabled:
    cc1: error: '-mdiv' requires '-march' to subsume the 'M' extension
    -fself-test: 8412281 pass(es) in 0.647173 seconds

Fix by tying both MUL and DIV option masks to the "M" standard extension
for integer multiplication and division.

Tested the above RV32EC-only toolchain using the GNU simulator:
                 === gcc Summary ===

  # of expected passes            211621
  # of unexpected failures        3018
  # of expected failures          1061
  # of unresolved testcases       5651
  # of unsupported tests          18958

Ok for trunk?

gcc/ChangeLog:

        * common/config/riscv/riscv-common.cc: Tie both MUL and DIV to
        the M extension.

Signed-off-by: Dimitar Dimitrov <dimi...@dinux.eu>
Actually, you should check these tests which the pre-commit tester flagged:

New Failures Across All Affected Targets (8 targets / 8 total targets)
FAIL: gcc.target/riscv/predef-7.c   -O0  (test for excess errors)
FAIL: gcc.target/riscv/predef-7.c   -O1  (test for excess errors)
FAIL: gcc.target/riscv/predef-7.c   -O2  (test for excess errors)
FAIL: gcc.target/riscv/predef-7.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  (test for excess errors)
FAIL: gcc.target/riscv/predef-7.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  (test for excess errors)
FAIL: gcc.target/riscv/predef-7.c   -O3 -g  (test for excess errors)
FAIL: gcc.target/riscv/predef-7.c   -Os  (test for excess errors)
FAIL: gcc.target/riscv/predef-9.c   -O0  (test for excess errors)
FAIL: gcc.target/riscv/predef-9.c   -O1  (test for excess errors)
FAIL: gcc.target/riscv/predef-9.c   -O2  (test for excess errors)
FAIL: gcc.target/riscv/predef-9.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  (test for excess errors)
FAIL: gcc.target/riscv/predef-9.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-objects  (test for excess errors)
FAIL: gcc.target/riscv/predef-9.c   -O3 -g  (test for excess errors)
FAIL: gcc.target/riscv/predef-9.c   -Os  (test for excess errors)


Jeff

Reply via email to