summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2015-08-27 13:27:02 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2015-08-27 13:27:02 +0000
commit8db97bdf563a97c566661d3cfb2075cb68b74307 (patch)
tree6c8e4c2a30c588f67e6c553245819e9a7c0d4173
parent418255b17714c32cb7588a19bcfae9991ad85081 (diff)
downloadgcc-8db97bdf563a97c566661d3cfb2075cb68b74307.tar.gz
2015-08-27 Richard Biener <rguenther@suse.de>
* passes.c (rest_of_decl_compilation): Guard early_global_decl call with !seen_error (). * cgraphunit.c (symbol_table::finalize_compilation_unit): Move early debug generation and finish... (symbol_table::compile): ... here to put it after a !seen_error () guard. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227258 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/cgraphunit.c20
-rw-r--r--gcc/passes.c5
3 files changed, 23 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6809668597f..0934bff5435 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2015-08-27 Richard Biener <rguenther@suse.de>
+
+ * passes.c (rest_of_decl_compilation): Guard early_global_decl
+ call with !seen_error ().
+ * cgraphunit.c (symbol_table::finalize_compilation_unit): Move
+ early debug generation and finish...
+ (symbol_table::compile): ... here to put it after a !seen_error ()
+ guard.
+
2015-08-27 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* config.gcc (*-*-solaris2*): Enable default_use_cxa_atexit on
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index a95ce9ee1fc..cdec63bc60a 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -2314,6 +2314,16 @@ 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)
{
@@ -2482,16 +2492,6 @@ symbol_table::finalize_compilation_unit (void)
/* Gimplify and lower thunks. */
analyze_functions (/*first_time=*/false);
- /* 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 ();
diff --git a/gcc/passes.c b/gcc/passes.c
index d8e9271fa89..1b677ac5a67 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -318,7 +318,10 @@ rest_of_decl_compilation (tree decl,
&& !decl_function_context (decl)
&& !current_function_decl
&& DECL_SOURCE_LOCATION (decl) != BUILTINS_LOCATION
- && !decl_type_context (decl))
+ && !decl_type_context (decl)
+ /* Avoid confusing the debug information machinery when there are
+ errors. */
+ && !seen_error ())
(*debug_hooks->early_global_decl) (decl);
}