diff options
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ipa-utils.h | 2 | ||||
-rw-r--r-- | gcc/lto-streamer.h | 11 | ||||
-rw-r--r-- | gcc/lto-symtab.c | 2 | ||||
-rw-r--r-- | gcc/tree-cfg.c | 6 |
5 files changed, 18 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a5824be71ad..f569cdab749 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -2,10 +2,16 @@ * cgraph.c (cgraph_get_body): Update call of lto_input_function_body. * gimple-streamer-in.c (input_gimple_stmt): Move sanity check to ... + * tree-cfg.c (verify_gimple_label): ... here. * ipa-utils.c: Include lto-streamer.h, ipa-inline.h (ipa_merge_profiles): New function. * lto-streamer-in.c (lto_read_body): Take node instead of fn_decl. (lto_input_function_body): Likewise. + * ipa-utils.h (ipa_merge_profiles): Declare. + * lto-streamer.h (lto_input_function_body): Update prototype. + (emit_label_in_global_context_p): Remove. + * lto-symtab.c: Include ipa-utils.h + (lto_cgraph_replace_node): Use ipa_merge_profiles. 2013-08-31 Jan Hubicka <jh@suse.cz> diff --git a/gcc/ipa-utils.h b/gcc/ipa-utils.h index 427245509b0..77ed6cee63a 100644 --- a/gcc/ipa-utils.h +++ b/gcc/ipa-utils.h @@ -44,6 +44,8 @@ void ipa_free_postorder_info (void); vec<cgraph_node_ptr> ipa_get_nodes_in_cycle (struct cgraph_node *); int ipa_reverse_postorder (struct cgraph_node **); tree get_base_var (tree); +void ipa_merge_profiles (struct cgraph_node *dst, + struct cgraph_node *src); /* In ipa-devirt.c */ diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h index 663ab24aa05..4a2ea0b2993 100644 --- a/gcc/lto-streamer.h +++ b/gcc/lto-streamer.h @@ -834,7 +834,8 @@ extern void lto_streamer_hooks_init (void); /* In lto-streamer-in.c */ extern void lto_input_cgraph (struct lto_file_decl_data *, const char *); extern void lto_reader_init (void); -extern void lto_input_function_body (struct lto_file_decl_data *, tree, +extern void lto_input_function_body (struct lto_file_decl_data *, + struct cgraph_node *, const char *); extern void lto_input_constructors_and_inits (struct lto_file_decl_data *, const char *); @@ -1030,14 +1031,6 @@ lto_tree_ref_encoder_get_tree (struct lto_tree_ref_encoder *encoder, return encoder->trees[idx]; } - -/* Return true if LABEL should be emitted in the global context. */ -static inline bool -emit_label_in_global_context_p (tree label) -{ - return DECL_NONLOCAL (label) || FORCED_LABEL (label); -} - /* Return number of encoded nodes in ENCODER. */ static inline int lto_symtab_encoder_size (lto_symtab_encoder_t encoder) diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c index 7c2add7232a..83026ef7c8c 100644 --- a/gcc/lto-symtab.c +++ b/gcc/lto-symtab.c @@ -28,6 +28,7 @@ along with GCC; see the file COPYING3. If not see #include "hashtab.h" #include "plugin-api.h" #include "lto-streamer.h" +#include "ipa-utils.h" /* Vector to keep track of external variables we've seen so far. */ vec<tree, va_gc> *lto_global_var_decls; @@ -80,6 +81,7 @@ lto_cgraph_replace_node (struct cgraph_node *node, /* Redirect incomming references. */ ipa_clone_referring ((symtab_node)prevailing_node, &node->symbol.ref_list); + ipa_merge_profiles (prevailing_node, node); lto_free_function_in_decl_state_for_node ((symtab_node)node); if (node->symbol.decl != prevailing_node->symbol.decl) diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index af8685c7a75..bc1e1ba90fc 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -4252,6 +4252,12 @@ verify_gimple_label (gimple stmt) if (TREE_CODE (decl) != LABEL_DECL) return true; + if (!DECL_NONLOCAL (decl) && !FORCED_LABEL (decl) + && DECL_CONTEXT (decl) != current_function_decl) + { + error ("label's context is not the current function decl"); + err |= true; + } uid = LABEL_DECL_UID (decl); if (cfun->cfg |