https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84620
Bug ID: 84620 Summary: DW_AT_GNU_entry_view should not use address class forms, but constant forms Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: mark at gcc dot gnu.org CC: aoliva at gcc dot gnu.org Target Milestone: --- In some situations gcc will emit the view index in DWARF as a DW_FORM_addr (or DW_FORM_GNU_addr_index). This is confusing to DWARF consumers which might process address class attributes specially. A view number really is a constant class attribute. Ideally it should use DW_FORM_udata. But if a constant sized form is needed, it could also use DW_FORM_data1, DW_FORM_data2, DW_FORM_data4 or DW_FORM_data8. The issue seems to come from gcc dwarf2out.c internally using dw_val_class_lbl_id, which seems to be used for the special DW_AT_high_pc case where it could be either an address or an (constant) offset from low_pc (so it can be represented either as address class or constant class). It seems view numbers are always constant class and so should use a different (or new) dw_val_class in dwarf2out.