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

Reply via email to