This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug ada/81361] [8 regression] broken exception handling at -O2


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

--- Comment #6 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
It looks like the DW_CFA_set_loc instruction is mishandled in FDEs:

        .set L$set$24,LEFDE3-LASFDE3
        .long L$set$24  # FDE Length
LASFDE3:
        .long   LASFDE3-EH_frame1       # FDE CIE offset
        .quad   LCOLDB1-.       # FDE initial location
        .set L$set$25,LCOLDE1-LCOLDB1
        .quad L$set$25  # FDE address range
        .byte   0x8     # uleb128 0x8; Augmentation size
        .quad   LLSDAC5-.       # Language Specific Data Area
        .byte   0x1     # DW_CFA_set_loc
        .quad   LCFI1-.
        .byte   0xe     # DW_CFA_def_cfa_offset
        .byte   0x10    # uleb128 0x10
        .byte   0x83    # DW_CFA_offset, column 0x3
        .byte   0x2     # uleb128 0x2

yields:

0x00000050: FDE
        length: 0x0000002c
   CIE_pointer: 0x00000000
    start_addr: 0x0000000000000068 ___cold_sect_of___ada_p + 0x0000000a
    range_size: 0x000000000000002a (end_addr = 0x0000000000000092)
  LSDA address: 0x00000000000000b8
  Instructions: 0x0000000000000068: CFA=rsp+8     rip=[rsp]
                DW_CFA_set_loc (0xffffffffffffff8e)
                DW_CFA_def_cfa_offset (16)
                DW_CFA_offset (rbx, -16)
                DW_CFA_nop
                DW_CFA_nop
                0xfffffffffffffff6: CFA=rsp+16    rbx=[rsp]  rip=[rsp+8]

so it looks like the PC-relative relocation is not applied to the operand of
the DW_CFA_set_loc, unlike what happens for start_addr and LSDA address.

This DW_CFA_set_loc instruction is emitted by add_cfis_to_fde for the second
FDE generated for the cold part of a function but doesn't seem necessary any
more: the to-be-attached patch yields a clean ACATS on Darwin as well as on
Linux with the -fno-dwarf2-cfi-asm option.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]