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

            Bug ID: 111372
           Summary: libgcc: RISCV C++ exception handling stack usage grew
                    in 13.1
           Product: gcc
           Version: 13.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: alexey.lapshin at espressif dot com
                CC: juzhe.zhong at rivai dot ai
  Target Milestone: ---

Created attachment 55877
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55877&action=edit
0001-libgcc-reduce-DWARF_FRAME_REGISTERS-to-use-only-base-registers.patch

After vector registers were added (commit
31380d4b7925912b9c34afe8cdb8dffe6cd50b94) c++ exception handling stack
consumption grew too large.
(GCC 12.2) ~1700 bytes vs (GCC 13.2) ~2800 bytes of stack required. This issue
may be critical for embedded projects that use C++.

As a temporary solution, I have patched gcc (see attached file).


It seems better to define macros (FIRST_PSEUDO_REGISTER, FIXED_REGISTERS...)
depending on "vector" extension is set or not. This would also prevent future
bugs.

Reply via email to