https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112648
Bug ID: 112648 Summary: RISC-V Vector parameter riscv-autovec-lmul value is ineffective Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: jeremy.bennett at embecosm dot com Target Milestone: --- Created attachment 56656 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56656&action=edit Reproducer source The GCC parameter riscv-autovec-lmul is used to force LMUL to be held to a particular value. Vital for processors which do not support changing LMUL. The parameter is not always effective. Reproducer (test.c): int a[8]; int b; int c() { for (; b; b++) a[b] = (float)b; } Compile with: riscv64-unknown-linux-gnu-gcc -march=rv64gcv -mabi=lp64d -O2 --param=riscv-autovec-lmul=m1 -S test.c Detect value of LMUL != m1 using grep: grep 'vsetvli.*\(\(m8\)\|\(m4\)\|\(m2\)\|\(mf2\)\|\(mf4\)\|\(mf8\)\)' test.s Output is: vsetvli a4,a3,e8,mf4,ta,ma System information ================== Using built-in specs. COLLECT_GCC=riscv64-unknown-linux-gnu-gcc COLLECT_LTO_WRAPPER=/home/jeremy/gittrees/mustang/install/libexec/gcc/riscv64-unknown-linux-gnu/14.0.0/lto-wrapper Target: riscv64-unknown-linux-gnu Configured with: /home/jeremy/gittrees/mustang/gcc/configure --target=riscv64-unknown-linux-gnu --prefix=/home/jeremy/gittrees/mustang/install --with-sysroot=/home/jeremy/gittrees/mustang/install/sysroot --with-pkgversion=g41aacdea55c --with-system-zlib --enable-shared --enable-tls --enable-languages=c,c++,fortran --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libsanitizer --disable-nls --disable-bootstrap --src=/home/jeremy/gittrees/mustang/gcc --enable-multilib --with-abi=lp64d --with-arch=rv64gc --with-tune= --with-isa-spec=20191213 'CFLAGS_FOR_TARGET=-O2 -mcmodel=medany' 'CXXFLAGS_FOR_TARGET=-O2 -mcmodel=medany' Thread model: posix Supported LTO compression algorithms: zlib gcc version 14.0.0 20231121 (experimental) (g41aacdea55c)