https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97599
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org, | |mark at gcc dot gnu.org, | |palves at redhat dot com --- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- So, let's first discuss how we want to represent these in DWARF, I've added further folks on CC, thoughts on that? If the function is the same rather than some clone with possibly changed calling convention, does your reading of DWARF suggest that each DW_TAG_subprogram should have its own DW_TAG_unspecified_parameters child, or e.g. DW_AT_calling_convention attribute, or is that something that can be inherited through DW_AT_abstract_origin and only overridden if different from the abstract origin? Then there is the question what to do with function clones, which, while can have different arguments and calling convention, but otherwise they still represent the whole function. And finally, the question of just outlined regions of functions, whether it is the outlined part of partial inlining, OpenMP/OpenACC etc. outlined regions etc. At least for this third set I think we really want some attribute that says they are partial (e.g. implementations should expect their start to be the start of the function) and with DW_AT_abstract_origin pointing to something more useful (e.g. the DW_TAG_lexical_block they are representing?). As for the implementation of this patch if DW_TAG_unspecified_parameters and/or DW_AT_calling_convention aren't inherited through DW_AT_abstract_origin by consumers, I think rather than what I'm doing in the above patch for LTO we could immediately after old_die = lookup_die (decl); remember for in_lto_p if old_die->die_child was NULL, that would stand for a freshly created DIE and then could be used as if (subr_die != old_die || old_die_was_empty) to decide whether to add DW_TAG_unspecified_parameters or not.