This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Guard early debug generation with !seen_errors ()
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 28 Aug 2015 09:43:26 +0200 (CEST)
- Subject: Re: [PATCH] Guard early debug generation with !seen_errors ()
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1508271445230 dot 4884 at zhemvz dot fhfr dot qr>
On Thu, 27 Aug 2015, Richard Biener wrote:
>
> This is already done for the TYPE_DECL case, the following avoids
> trying to generate any debug after we've seen errors for the
> calls to early_global_decl.
>
> Bootstrapped on x86_64-unknown-linux-gnu, testing and gdb testing in
> progress.
The following fixes early LTO debug fallout.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
2015-08-28 Richard Biener <rguenther@suse.de>
* cgraphunit.c (symbol_table::compile): Move early debug generation
and finish...
(symbol_table::finalize_compilation_unit): ... back here and
add a !seen_error () guard.
Index: gcc/cgraphunit.c
===================================================================
--- gcc/cgraphunit.c (revision 227258)
+++ gcc/cgraphunit.c (working copy)
@@ -2314,16 +2314,6 @@ symbol_table::compile (void)
symtab_node::verify_symtab_nodes ();
#endif
- /* Emit early debug for reachable functions, and by consequence,
- locally scoped symbols. */
- struct cgraph_node *cnode;
- FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (cnode)
- (*debug_hooks->early_global_decl) (cnode->decl);
-
- /* Clean up anything that needs cleaning up after initial debug
- generation. */
- (*debug_hooks->early_finish) ();
-
timevar_push (TV_CGRAPHOPT);
if (pre_ipa_mem_report)
{
@@ -2492,6 +2482,19 @@ symbol_table::finalize_compilation_unit
/* Gimplify and lower thunks. */
analyze_functions (/*first_time=*/false);
+ if (!seen_error ())
+ {
+ /* Emit early debug for reachable functions, and by consequence,
+ locally scoped symbols. */
+ struct cgraph_node *cnode;
+ FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (cnode)
+ (*debug_hooks->early_global_decl) (cnode->decl);
+
+ /* Clean up anything that needs cleaning up after initial debug
+ generation. */
+ (*debug_hooks->early_finish) ();
+ }
+
/* Finally drive the pass manager. */
compile ();