Skip to content

Commit 62b59bc

Browse files
committed
debug/113488 - DW_AT_abstract_origin to self
The new sanity check avoiding creating of DIE refs to self triggers on the PRs testcase when using -g1 and -ffat-lto-objects as while early DWARF with -g1 doesn't contain any DIEs for LABEL_DECLs later cloning will still mark DECLs as in if they would via dwarf2out_abstract_function calling set_block_origin_self. Instead of messing with the delicate setup of dwarf2out at this stage the following simply rectifies things after the fact during LTO streaming when the decl indicates there's an early DIE but there isn't fixup that indication. PR debug/113488 * lto-streamer-in.cc (lto_read_tree_1): When there isn't an early DIE but there should be, do not pretend there is.
1 parent 6ce7008 commit 62b59bc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

gcc/lto-streamer-in.cc

+5
Original file line numberDiff line numberDiff line change
@@ -1746,6 +1746,11 @@ lto_read_tree_1 (class lto_input_block *ib, class data_in *data_in, tree expr)
17461746
dref_entry e = { expr, str, off };
17471747
dref_queue.safe_push (e);
17481748
}
1749+
/* When there's no early DIE to refer to but dwarf2out set up
1750+
things in a way to expect that fixup. This tends to happen
1751+
with -g1, see for example PR113488. */
1752+
else if (DECL_P (expr) && DECL_ABSTRACT_ORIGIN (expr) == expr)
1753+
DECL_ABSTRACT_ORIGIN (expr) = NULL_TREE;
17491754
}
17501755
}
17511756

0 commit comments

Comments
 (0)