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

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
This is yet another test that should be dg-skip-if -fcompare-debug and
-fno-asynchronous-unwind-tables.
The code is different depending on the __GCC_HAVE_DWARF2_CFI_ASM macro, which
is dependent on whether -g -fno-asynchronous-unwind-tables is present or not.
$ ./cc1 -quiet -g -fno-asynchronous-unwind-tables -dD -E /dev/null | grep CFI
#define __GCC_HAVE_DWARF2_CFI_ASM 1
$ ./cc1 -quiet -g0 -fno-asynchronous-unwind-tables -dD -E /dev/null | grep CFI
$ ./cc1 -quiet -g -gtoggle -fno-asynchronous-unwind-tables -dD -E /dev/null |
grep CFI
$ ./cc1 -quiet -g -fasynchronous-unwind-tables -dD -E /dev/null | grep CFI
#define __GCC_HAVE_DWARF2_CFI_ASM 1
$ ./cc1 -quiet -g0 -fasynchronous-unwind-tables -dD -E /dev/null | grep CFI
#define __GCC_HAVE_DWARF2_CFI_ASM 1
$ ./cc1 -quiet -g -gtoggle -fasynchronous-unwind-tables -dD -E /dev/null | grep
CFI
#define __GCC_HAVE_DWARF2_CFI_ASM 1
This macro is predefined when code should use .cfi_* directives in inline asm,
which is not when the assembler doesn't support them obviously, but otherwise
either when -fasynchronous-unwind-tables is on, or when -g is on.  If neither
is on, neither .eh_frame nor .debug_frame will be emitted and thus the .cfi*
directives are undesirable.

Reply via email to