riscv-software-src / riscof

BSD 3-Clause "New" or "Revised" License
63 stars 40 forks source link

Slow build with GCC 12.2 #76

Open davidharrishmc opened 1 year ago

davidharrishmc commented 1 year ago

riscof runs normally for me with GCC 11.x installed. It's slow but usable.

I've been trying to upgrade to GCC 12.2 (specifically 2023.01.31).

riscof appears to hang at INFO | Running Tests on Reference Model.

Looking into riscof_work, I see that the reference runs have become extremely slow. In particular, I get to rv32i_m/D/src/fmadd.d_b15-01.S. Generating the objdump takes 4 minutes. It's similar on the other FMA b_15 variants.

Is this a known issue?

I'm interested in compiling the bit manipulation tests. Is there an older version of gcc that is adequate?

Thank you,

David

-rw-rw-r-- 1 harris harris 355094731 Feb 7 16:04 fmadd.d_b15-01.log -rwxrwxr-x 1 harris harris 15646896 Feb 7 16:00 ref.elf -rw-rw-r-- 1 harris harris 174017680 Feb 7 16:04 ref.elf.objdump -rw-rw-r-- 1 harris harris 3672216 Feb 7 16:04 Reference-sail_c_simulator.signature

davidharrishmc commented 1 year ago

I've tracked the issue to a difference between binutils 2.37 and binutils 2.39.

Disassembling fmadd.d_b15-01 takes 2.2 seconds with 2.37 and 3 minutes 36 seconds with binutils 2.39. See the logs below.


harris@vlsi:~/cvw/tests/riscof/work/riscv-arch-test/rv32i_m/D/src/fmadd.d_b15-01.S/ref$ /opt/riscv/riscv-gnu-toolchain-orig/bin/riscv64-unknown-elf-objdump -v GNU objdump (GNU Binutils) 2.37

harris@vlsi:~/cvw/tests/riscof/work/riscv-arch-test/rv32i_m/D/src/fmadd.d_b15-01.S/ref$ time /opt/riscv/riscv-gnu-toolchain-orig/bin/riscv64-unknown-elf-objdump -D ref.elf > ref.elf.objdump3

real 0m2.206s user 0m2.064s sys 0m0.072s

$ riscv64-unknown-elf-objdump -v GNU objdump (GNU Binutils) 2.39

harris@vlsi:~/cvw/tests/riscof/work/riscv-arch-test/rv32i_m/D/src/fmadd.d_b15-01.S/ref$ time riscv64-unknown-elf-objdump -D ref.elf > ref.elf.objdump2

real 3m36.759s user 3m36.673s sys 0m0.080s

davidharrishmc commented 1 year ago

I'm not sure if posting this in riscv-gnu-toolchain is more appropriate. I've posted an issue there.

https://github.com/riscv-collab/riscv-gnu-toolchain/issues/1188