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>
OK.
jeff

Reply via email to