From 0e2eb6abeb77d86e672f0872bca5dd3528134734 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 24 Jan 2019 12:36:14 +0000 Subject: [PATCH] re PR lto/87187 (FAIL: gfortran.dg/short_circuiting_3.f90 -g -flto (internal compiler error) on darwin) 2019-01-24 Richard Biener PR lto/87187 * tree-streamer-out.c (write_ts_decl_common_tree_pointers): When in "legacy" debug mode make sure to reset self-origins. From-SVN: r268236 --- gcc/ChangeLog | 6 ++++++ gcc/tree-streamer-out.c | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f7013b71ead..960e8dacef9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-01-24 Richard Biener + + PR lto/87187 + * tree-streamer-out.c (write_ts_decl_common_tree_pointers): + When in "legacy" debug mode make sure to reset self-origins. + 2019-01-24 Martin Liska PR gcov-profile/88994 diff --git a/gcc/tree-streamer-out.c b/gcc/tree-streamer-out.c index ce7e8086b39..b66426387d6 100644 --- a/gcc/tree-streamer-out.c +++ b/gcc/tree-streamer-out.c @@ -603,7 +603,16 @@ write_ts_decl_common_tree_pointers (struct output_block *ob, tree expr, special handling in LTO, it must be handled by streamer hooks. */ stream_write_tree (ob, DECL_ATTRIBUTES (expr), ref_p); - stream_write_tree (ob, DECL_ABSTRACT_ORIGIN (expr), ref_p); + + /* On non-early-LTO enabled targets we claim we compiled with -g0 + but dwarf2out still did its set_decl_origin_self game fooling + itself late. Und that here since we won't have access to the + early generated abstract DIEs. */ + tree ao = DECL_ABSTRACT_ORIGIN (expr); + if (debug_info_level == DINFO_LEVEL_NONE + && ao == expr) + ao = NULL_TREE; + stream_write_tree (ob, ao, ref_p); if ((VAR_P (expr) || TREE_CODE (expr) == PARM_DECL) && DECL_HAS_VALUE_EXPR_P (expr)) -- 2.30.2