From cb775ecd6e437de8fdba9a3f173f3787e90e98f2 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Mon, 2 Jan 2023 16:18:02 +0100 Subject: libgcc: Specialize execute_cfa_program in DWARF unwinder for alignments The parameters fs->data_align and fs->code_align always have fixed values for a particular target in GCC-generated code. Specialize execute_cfa_program for these values, to avoid multiplications. gcc/c-family/ * c-cppbuiltin.cc (c_cpp_builtins): Define __LIBGCC_DWARF_CIE_DATA_ALIGNMENT__. libgcc/ * unwind-dw2-execute_cfa.h: New file. Extracted from the execute_cfa_program function in unwind-dw2.c. * unwind-dw2.c (execute_cfa_program_generic): New function. (execute_cfa_program_specialized): Likewise. (execute_cfa_program): Call execute_cfa_program_specialized or execute_cfa_program_generic, as appropriate. --- gcc/c-family/c-cppbuiltin.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gcc') diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc index 011478c..ddfd63b 100644 --- a/gcc/c-family/c-cppbuiltin.cc +++ b/gcc/c-family/c-cppbuiltin.cc @@ -1527,6 +1527,8 @@ c_cpp_builtins (cpp_reader *pfile) builtin_define_with_int_value ("__LIBGCC_DWARF_REG_SIZES_CONSTANT__", value); } + builtin_define_with_int_value ("__LIBGCC_DWARF_CIE_DATA_ALIGNMENT__", + DWARF_CIE_DATA_ALIGNMENT); #ifdef EH_RETURN_STACKADJ_RTX cpp_define (pfile, "__LIBGCC_EH_RETURN_STACKADJ_RTX__"); #endif -- cgit v1.1