From 808bdf1bb291f34943d330ebed53d5fba99e3fda Mon Sep 17 00:00:00 2001 From: Andrew Stubbs Date: Sat, 16 Jan 2021 15:18:07 +0000 Subject: [PATCH] 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.c (gen_subprogram_die): Check offload attributes only. --- gcc/dwarf2out.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index dedfeaf865f2..61d8a3f574cb 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -23094,9 +23094,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)) -- 2.39.5