aboutsummaryrefslogtreecommitdiff
path: root/gcc/passes.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-09-17 09:47:43 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-09-17 09:47:43 +0000
commitbf2dbec420f5c7a05af6ca3185a4ab297b80a905 (patch)
tree6e2ef835fcb80c96a6f0fdaa4402ece9839684f0 /gcc/passes.c
parente3b5d7bae1c9cc9bd1faa905c0526dce2ee90924 (diff)
downloadgcc-bf2dbec420f5c7a05af6ca3185a4ab297b80a905.zip
gcc-bf2dbec420f5c7a05af6ca3185a4ab297b80a905.tar.gz
gcc-bf2dbec420f5c7a05af6ca3185a4ab297b80a905.tar.bz2
passes.c (rest_of_decl_compilation): Always call early_global_decl debug hook when we created a varpool node.
2015-09-17 Richard Biener <rguenther@suse.de> * passes.c (rest_of_decl_compilation): Always call early_global_decl debug hook when we created a varpool node. * dwarf2out.c (dwarf2out_late_global_decl): When in LTO call dwarf2out_early_global_decl, when not just add location or value attributes to existing DIEs. From-SVN: r227857
Diffstat (limited to 'gcc/passes.c')
-rw-r--r--gcc/passes.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/passes.c b/gcc/passes.c
index 1b677ac..274e508 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -318,7 +318,17 @@ 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)
+ /* If we created a varpool node for the decl make sure to
+ call early_global_decl. Otherwise we miss changes
+ introduced by member definitions like
+ struct A { static int staticdatamember; };
+ int A::staticdatamember;
+ and thus have incomplete early debug and late debug
+ called from varpool node removal fails to handle it
+ properly. */
+ || (TREE_CODE (decl) == VAR_DECL
+ && TREE_STATIC (decl) && !DECL_EXTERNAL (decl)))
/* Avoid confusing the debug information machinery when there are
errors. */
&& !seen_error ())