From 5d52d2c949fe6277fd1f31be8d6f48e1dae06652 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 24 Aug 2017 13:41:51 +0000 Subject: re PR debug/81936 (ICE in dwarf2out_die_ref_for_decl, at dwarf2out.c:5543) 2017-08-24 Richard Biener PR debug/81936 * dwarf2out.c (output_die): Handle flag_generate_offload like flag_generate_lto. (output_comp_unit): Likewise. (gen_array_type_die): Likewise. (dwarf2out_early_finish): Likewise. (note_variable_value_in_expr): Likewise. (dwarf2out_finish): Likewise. Adjust assert. * cgraphunit.c (symbol_table::compile): Move setting of flag_generate_offload earlier ... (symbol_table::finalize_compilation_unit): ... here, before early debug finalization. From-SVN: r251332 --- gcc/cgraphunit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gcc/cgraphunit.c') diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index e8cc765..a287f0d 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -2464,10 +2464,6 @@ symbol_table::compile (void) fprintf (stderr, "Performing interprocedural optimizations\n"); state = IPA; - /* Offloading requires LTO infrastructure. */ - if (!in_lto_p && g->have_offload) - flag_generate_offload = 1; - /* If LTO is enabled, initialize the streamer hooks needed by GIMPLE. */ if (flag_generate_lto || flag_generate_offload) lto_streamer_hooks_init (); @@ -2614,6 +2610,10 @@ symbol_table::finalize_compilation_unit (void) /* Gimplify and lower thunks. */ analyze_functions (/*first_time=*/false); + /* Offloading requires LTO infrastructure. */ + if (!in_lto_p && g->have_offload) + flag_generate_offload = 1; + if (!seen_error ()) { /* Emit early debug for reachable functions, and by consequence, -- cgit v1.1