https://gcc.gnu.org/g:854da66d39a77b339298a44f5135364c84254514
commit r17-5958-g854da66d39a77b339298a44f5135364c84254514 Author: Iain Sandoe <[email protected]> Date: Mon Oct 12 18:28:20 2026 +0100 dwarf2out: Allow for an empty cie_cfi_vec. The RTL front end can start at a pass later than the initialisation of the cie/cfi vector and so we must cater for it being unset. This fires for RTL testcases on platform which do not use cfi instructions. gcc/ChangeLog: * dwarf2out.cc (output_call_frame_info): Check for unset cie/cfi vector before iteration. Signed-off-by: Iain Sandoe <[email protected]> Diff: --- gcc/dwarf2out.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc index 9964fdc8da8f..d4402926f1ea 100644 --- a/gcc/dwarf2out.cc +++ b/gcc/dwarf2out.cc @@ -943,8 +943,12 @@ output_call_frame_info (int for_eh) eh_data_format_name (fde_encoding)); } - FOR_EACH_VEC_ELT (*cie_cfi_vec, i, cfi) - output_cfi (cfi, NULL, for_eh); + /* cie_cfi_vec is created lazily by the dwarf2 frame pass. + The RTL front end allows for starting from a pass after that so that + this can be absent. */ + if (cie_cfi_vec) + FOR_EACH_VEC_ELT (*cie_cfi_vec, i, cfi) + output_cfi (cfi, NULL, for_eh); /* Pad the CIE out to an address sized boundary. */ ASM_OUTPUT_ALIGN (asm_out_file,
