[Bug target/121018] New: RVV codegen: spills unused vector registers on function call between RVV intrinsics

camel-cdr at protonmail dot com gcc-bugzilla@gcc.gnu.org
Wed Jul 9 19:48:53 GMT 2025


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121018

            Bug ID: 121018
           Summary: RVV codegen: spills unused vector registers on
                    function call between RVV intrinsics
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: camel-cdr at protonmail dot com
  Target Milestone: ---

The code snippet:

#include <riscv_vector.h>

extern int foo(void);
vuint8m1_t bar(vuint8m1_t x) {
        foo();
        return x;
}

causes gcc to spill vector registers v0-v8, v24-v31 around the foo function
call to the stack, while only v8 needs to be spilled.

See: https://godbolt.org/z/jcrPsrMrr


More information about the Gcc-bugs mailing list