* 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.
From-SVN: r202131
* 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>
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 */
/* 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 *);
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)
#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;
/* 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)
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