-mcpu sets both -march and -mtune. So using both march and mcpu is not necessary unless you don’t want the default arch specified by mcpu. march chooses the architecture extensions that are enabled. mtune chooses the instruction latencies and pipeline model used by the instruction scheduler.
To see what -mcpu does, you can run gcc with -v to see the options passed to cc1. So if I do this
riscv64-unknown-linux-gnu-gcc -mcpu=sifive-u74 -v -S tmp.c
Then I see in the -v output
/home/jimw/FOSS/install-riscv64/libexec/gcc/riscv64-unknown-linux-gnu/11.1.0/cc1 -quiet -v tmp.c -quiet -dumpbase tmp.c -dumpbase-ext .c -mcpu=sifive-u74 -mtune=sifive-7-series -march=rv64imafdc -mabi=lp64d -march=rv64imafdc -version -o tmp.s
and you can see that -mcpu was expanded to -march and -mtune options.
sifive-s7 expands to march=rv64gc mtune=sifive-7-series so you would need to use a march option in that case to get rv64imac.
If you know what arch and tune you want, then it may be simpler to avoid mcpu and use march and mtune directly.
You can also see what mcpu does by looking at the source file for it.