aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2009-04-19 13:52:03 -0400
committerDiego Novillo <dnovillo@gcc.gnu.org>2009-04-19 13:52:03 -0400
commit3baf459d85855934a326ef7e6a4dc4de3f3c8056 (patch)
treebb5a4b60b2fba01c8f07af7dea9726c29ea518ca /gcc
parentaa50850225d70521ace3948a8e5858425a918f6a (diff)
downloadgcc-3baf459d85855934a326ef7e6a4dc4de3f3c8056.zip
gcc-3baf459d85855934a326ef7e6a4dc4de3f3c8056.tar.gz
gcc-3baf459d85855934a326ef7e6a4dc4de3f3c8056.tar.bz2
toplev.c (compile_file): Move call to coverage_finish ...
* toplev.c (compile_file): Move call to coverage_finish ... * cgraphunit.c (ipa_passes): ... here. Call cgraph_process_new_functions. * ipa-utils.c (get_base_var): Handle CONSTRUCTOR. * Makefile.in (cgraphunit.o): Add dependency on COVERAGE_H. From-SVN: r146354
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/Makefile.in2
-rw-r--r--gcc/cgraphunit.c12
-rw-r--r--gcc/ipa-utils.c3
-rw-r--r--gcc/toplev.c5
5 files changed, 23 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1343784..2566ff7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2009-04-19 Diego Novillo <dnovillo@google.com>
+
+ * toplev.c (compile_file): Move call to coverage_finish ...
+ * cgraphunit.c (ipa_passes): ... here.
+ Call cgraph_process_new_functions.
+ * ipa-utils.c (get_base_var): Handle CONSTRUCTOR.
+ * Makefile.in (cgraphunit.o): Add dependency on COVERAGE_H.
+
2009-04-19 Jan Hubicka <jh@suse.cz>
* cgraph.c (cgraph_create_edge, cgraph_set_call_stmt): Set proper cfun.
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 1e5f33f..f4f6764 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -2615,7 +2615,7 @@ cgraphunit.o : cgraphunit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TARGET_H) $(CGRAPH_H) intl.h pointer-set.h $(FUNCTION_H) $(GIMPLE_H) \
$(TREE_FLOW_H) $(TREE_PASS_H) $(C_COMMON_H) debug.h $(DIAGNOSTIC_H) \
$(FIBHEAP_H) output.h $(PARAMS_H) $(RTL_H) $(TIMEVAR_H) $(IPA_PROP_H) \
- gt-cgraphunit.h tree-iterator.h
+ gt-cgraphunit.h tree-iterator.h $(COVERAGE_H)
cgraphbuild.o : cgraphbuild.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) langhooks.h $(CGRAPH_H) intl.h pointer-set.h $(GIMPLE_H) \
$(TREE_FLOW_H) $(TREE_PASS_H)
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 859eadd..a99b7df 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -134,6 +134,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-iterator.h"
#include "tree-pass.h"
#include "output.h"
+#include "coverage.h"
static void cgraph_expand_all_functions (void);
static void cgraph_mark_functions_to_output (void);
@@ -978,6 +979,8 @@ cgraph_finalize_compilation_unit (void)
cgraph_analyze_functions ();
timevar_pop (TV_CGRAPH);
}
+
+
/* Figure out what functions we want to assemble. */
static void
@@ -1238,6 +1241,15 @@ ipa_passes (void)
gimple_register_cfg_hooks ();
bitmap_obstack_initialize (NULL);
execute_ipa_pass_list (all_ipa_passes);
+
+ /* Generate coverage variables and constructors. */
+ coverage_finish ();
+
+ /* Process new functions added. */
+ set_cfun (NULL);
+ current_function_decl = NULL;
+ cgraph_process_new_functions ();
+
bitmap_obstack_release (NULL);
}
diff --git a/gcc/ipa-utils.c b/gcc/ipa-utils.c
index 2fe0396..97a2b3c 100644
--- a/gcc/ipa-utils.c
+++ b/gcc/ipa-utils.c
@@ -222,7 +222,8 @@ get_base_var (tree t)
&& (!CONSTANT_CLASS_P (t))
&& TREE_CODE (t) != LABEL_DECL
&& TREE_CODE (t) != FUNCTION_DECL
- && TREE_CODE (t) != CONST_DECL)
+ && TREE_CODE (t) != CONST_DECL
+ && TREE_CODE (t) != CONSTRUCTOR)
{
t = TREE_OPERAND (t, 0);
}
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 4c6efbc..95b5ba3 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -993,11 +993,6 @@ compile_file (void)
varpool_assemble_pending_decls ();
finish_aliases_2 ();
- /* This must occur after the loop to output deferred functions.
- Else the coverage initializer would not be emitted if all the
- functions in this compilation unit were deferred. */
- coverage_finish ();
-
/* Likewise for mudflap static object registrations. */
if (flag_mudflap)
mudflap_finish_file ();