diff options
author | Florian Weimer <fweimer@redhat.com> | 2023-01-02 16:18:02 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2023-01-02 16:18:02 +0100 |
commit | 97bbdb726aba76ead550e25061029cf0aa78671b (patch) | |
tree | 03ebd3c211a0c1a51ac08db65a25a9285dfb516a /gcc/c-family/c-cppbuiltin.cc | |
parent | 3b6cac2b44b384cd2091eaeaebeb3478c253a25d (diff) | |
download | gcc-97bbdb726aba76ead550e25061029cf0aa78671b.zip gcc-97bbdb726aba76ead550e25061029cf0aa78671b.tar.gz gcc-97bbdb726aba76ead550e25061029cf0aa78671b.tar.bz2 |
Define __LIBGCC_DWARF_REG_SIZES_CONSTANT__ if DWARF register size is constant
And use that to speed up the libgcc unwinder.
gcc/
* debug.h (dwarf_reg_sizes_constant): Declare.
* dwarf2cfi.cc (dwarf_reg_sizes_constant): New function.
gcc/c-family/
* c-cppbuiltin.cc (__LIBGCC_DWARF_REG_SIZES_CONSTANT__):
Define if constant is known.
libgcc/
* unwind-dw2.c (dwarf_reg_size): New function.
(_Unwind_GetGR, _Unwind_SetGR, _Unwind_SetGRPtr)
(_Unwind_SetSpColumn, uw_install_context_1): Use it.
(uw_init_context_1): Do not initialize dwarf_reg_size_table
if not in use.
Diffstat (limited to 'gcc/c-family/c-cppbuiltin.cc')
-rw-r--r-- | gcc/c-family/c-cppbuiltin.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc index 333f3e1..011478c 100644 --- a/gcc/c-family/c-cppbuiltin.cc +++ b/gcc/c-family/c-cppbuiltin.cc @@ -1521,6 +1521,12 @@ c_cpp_builtins (cpp_reader *pfile) #endif builtin_define_with_int_value ("__LIBGCC_DWARF_FRAME_REGISTERS__", DWARF_FRAME_REGISTERS); + { + int value = dwarf_reg_sizes_constant (); + if (value > 0) + builtin_define_with_int_value ("__LIBGCC_DWARF_REG_SIZES_CONSTANT__", + value); + } #ifdef EH_RETURN_STACKADJ_RTX cpp_define (pfile, "__LIBGCC_EH_RETURN_STACKADJ_RTX__"); #endif |