From: Andrew Stubbs Date: Sat, 16 Jan 2021 15:18:07 +0000 (+0000) Subject: Correct fix offload dwarf info X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=353afd4ec8b7d72786b0a12ab78553acc3395c72;p=thirdparty%2Fgcc.git Correct fix offload dwarf info The previous patch wasn't quite right, apparently. Somehow the behaviour changed after another clean build? This tweak fixes it. This patch should be squashed with fdcb23540a2 to go to mainline. gcc/ChangeLog: * dwarf2out.cc (gen_subprogram_die): Check offload attributes only. --- diff --git a/gcc/ChangeLog.omp b/gcc/ChangeLog.omp index 5f4736110467..b977f98af979 100644 --- a/gcc/ChangeLog.omp +++ b/gcc/ChangeLog.omp @@ -1,3 +1,7 @@ +2021-01-16 Andrew Stubbs + + * dwarf2out.cc (gen_subprogram_die): Check offload attributes only. + 2021-01-15 Andrew Stubbs * dwarf2out.cc (add_location_or_const_value_attribute): Set diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc index 50b5b1925b34..46e22c7eb91c 100644 --- a/gcc/dwarf2out.cc +++ b/gcc/dwarf2out.cc @@ -23770,9 +23770,8 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) will ignore the function and everything nested within unless we give it a notional code range (the values aren't important, as long as they are valid). */ - if (flag_generate_offload - && lookup_attribute ("omp target entrypoint", - DECL_ATTRIBUTES (decl)) + if (lookup_attribute ("omp target entrypoint", + DECL_ATTRIBUTES (decl)) && subr_die->die_parent && subr_die->die_parent->die_tag == DW_TAG_subprogram && !get_AT_low_pc (subr_die->die_parent))