mirror of git://gcc.gnu.org/git/gcc.git
lto-symtab.c (lto_cgraph_replace_node): Update.
* lto-symtab.c (lto_cgraph_replace_node): Update. * cgraphbuild.c (record_reference, record_type_list, record_eh_tables, mark_address, mark_load, mark_store): Update. * cgraph.c (cgraph_same_body_alias, dump_cgraph_node, cgraph_create_virtual_clone, cgraph_for_node_thunks_and_aliases): Update. * cgraph.h (symtab_node_def, symtab_node, const_symtab_node): Remove. (cgraph_alias_aliased_node, varpool_alias_aliased_node): Update. * reload.c: Fix typo in comment. * rtlanal.c: Likewise. * tree-emultls.c (gen_emutls_addr): Update. * ipa-reference.c (analyze_function): Update. * cgraphunit.c (cgraph_analyze_function, cgraph_process_same_body_aliases, assemble_thunks_and_aliases): Update. * ipa-ref.c (ipa_record_reference): Reorg to avoid reference types. (ipa_remove_reference): Likewise. (ipa_remove_all_refering): Rename to ... (ipa_remove_all_referring): ... this one; update. (ipa_dump_references): Update. (ipa_dump_referring): Update. (ipa_clone_references): Update. (ipa_clone_refering): Rename to ... (ipa_clone_referring): ... this one; update. (ipa_ref_cannot_lead_to_return): Update. (ipa_ref_has_aliases_p): Update. * ipa-ref.h (symtab_node_def, symtab_node, const_symtab_node): New forward typedefs. (ipa_ref_type): Remove. (ipa_ref_ptr_u): Remove. (ipa_ref): Remove referencing, refered, refered_index, refering_type and refered_type; add referring, referred and referred_index. (ipa_ref_list): Rename refering to referring. (ipa_record_reference, ipa_remove_all_referring, ipa_dump_referring, ipa_clone_references, ipa_clone_referring): Update prototypes. * lto-cgraph.c (referenced_from_other_partition_p): Update. (lto_output_ref): Update. (add_references): Update. (input_varpool_node): Update. (input_refs): Update. * ipa-ref-inline.h (ipa_ref_node): Update. (ipa_ref_varpool_node): Update. (ipa_ref_referring_node); Update. (ipa_ref_referring_varpool_node): Update. (ipa_ref_referring_ref_list); Update. (ipa_ref_referred_ref_list): Update. (ipa_ref_list_first_referring): Update. (ipa_empty_ref_list): Update. (ipa_ref_list_refering_iterate): Rename to ... (ipa_ref_list_referring_iterate): ... this one. * cse.c: Update comment. * ipa-utils.c (ipa_reverse_postorder): Update. * tree-ssa-alias.c: Update. * ipa-inline.c (reset_edge_caches): Update. (update_caller_keys): Update. * ipa-inline.h: Update comments. * jump.c: Update comment. * alias.c: Likewise. * ipa.c (process_references): Update. (cgraph_remove_unreachable_nodes): Likewise. (ipa_discover_readonly_nonaddressable_var): Likewise. (cgraph_address_taken_from_non_vtable_p): Likewise. * trans-mem.c (ipa_tm_execute): Update. * simplify-rtx.c: Fix comment. * rtl.c: Fix comment. * symtab.c (symtab_unregister_node): Update. * varpool.c (dump_varpool_node): Update. (varpool_analyze_pending_decls): Update. (assemble_aliases): Update. (varpool_for_node_and_aliases): Update. From-SVN: r186564
This commit is contained in:
parent
f314862027
commit
5932a4d411
|
|
@ -1,3 +1,76 @@
|
||||||
|
2012-04-18 Jan Hubicka <jh@suse.cz>
|
||||||
|
|
||||||
|
* lto-symtab.c (lto_cgraph_replace_node): Update.
|
||||||
|
* cgraphbuild.c (record_reference, record_type_list,
|
||||||
|
record_eh_tables, mark_address, mark_load, mark_store): Update.
|
||||||
|
* cgraph.c (cgraph_same_body_alias, dump_cgraph_node,
|
||||||
|
cgraph_create_virtual_clone, cgraph_for_node_thunks_and_aliases):
|
||||||
|
Update.
|
||||||
|
* cgraph.h (symtab_node_def, symtab_node, const_symtab_node): Remove.
|
||||||
|
(cgraph_alias_aliased_node, varpool_alias_aliased_node): Update.
|
||||||
|
* reload.c: Fix typo in comment.
|
||||||
|
* rtlanal.c: Likewise.
|
||||||
|
* tree-emultls.c (gen_emutls_addr): Update.
|
||||||
|
* ipa-reference.c (analyze_function): Update.
|
||||||
|
* cgraphunit.c (cgraph_analyze_function,
|
||||||
|
cgraph_process_same_body_aliases, assemble_thunks_and_aliases):
|
||||||
|
Update.
|
||||||
|
* ipa-ref.c (ipa_record_reference): Reorg to avoid reference types.
|
||||||
|
(ipa_remove_reference): Likewise.
|
||||||
|
(ipa_remove_all_refering): Rename to ...
|
||||||
|
(ipa_remove_all_referring): ... this one; update.
|
||||||
|
(ipa_dump_references): Update.
|
||||||
|
(ipa_dump_referring): Update.
|
||||||
|
(ipa_clone_references): Update.
|
||||||
|
(ipa_clone_refering): Rename to ...
|
||||||
|
(ipa_clone_referring): ... this one; update.
|
||||||
|
(ipa_ref_cannot_lead_to_return): Update.
|
||||||
|
(ipa_ref_has_aliases_p): Update.
|
||||||
|
* ipa-ref.h (symtab_node_def, symtab_node, const_symtab_node): New
|
||||||
|
forward typedefs.
|
||||||
|
(ipa_ref_type): Remove.
|
||||||
|
(ipa_ref_ptr_u): Remove.
|
||||||
|
(ipa_ref): Remove referencing, refered, refered_index, refering_type
|
||||||
|
and refered_type; add referring, referred and referred_index.
|
||||||
|
(ipa_ref_list): Rename refering to referring.
|
||||||
|
(ipa_record_reference, ipa_remove_all_referring, ipa_dump_referring,
|
||||||
|
ipa_clone_references, ipa_clone_referring): Update prototypes.
|
||||||
|
* lto-cgraph.c (referenced_from_other_partition_p): Update.
|
||||||
|
(lto_output_ref): Update.
|
||||||
|
(add_references): Update.
|
||||||
|
(input_varpool_node): Update.
|
||||||
|
(input_refs): Update.
|
||||||
|
* ipa-ref-inline.h (ipa_ref_node): Update.
|
||||||
|
(ipa_ref_varpool_node): Update.
|
||||||
|
(ipa_ref_referring_node); Update.
|
||||||
|
(ipa_ref_referring_varpool_node): Update.
|
||||||
|
(ipa_ref_referring_ref_list); Update.
|
||||||
|
(ipa_ref_referred_ref_list): Update.
|
||||||
|
(ipa_ref_list_first_referring): Update.
|
||||||
|
(ipa_empty_ref_list): Update.
|
||||||
|
(ipa_ref_list_refering_iterate): Rename to ...
|
||||||
|
(ipa_ref_list_referring_iterate): ... this one.
|
||||||
|
* cse.c: Update comment.
|
||||||
|
* ipa-utils.c (ipa_reverse_postorder): Update.
|
||||||
|
* tree-ssa-alias.c: Update.
|
||||||
|
* ipa-inline.c (reset_edge_caches): Update.
|
||||||
|
(update_caller_keys): Update.
|
||||||
|
* ipa-inline.h: Update comments.
|
||||||
|
* jump.c: Update comment.
|
||||||
|
* alias.c: Likewise.
|
||||||
|
* ipa.c (process_references): Update.
|
||||||
|
(cgraph_remove_unreachable_nodes): Likewise.
|
||||||
|
(ipa_discover_readonly_nonaddressable_var): Likewise.
|
||||||
|
(cgraph_address_taken_from_non_vtable_p): Likewise.
|
||||||
|
* trans-mem.c (ipa_tm_execute): Update.
|
||||||
|
* simplify-rtx.c: Fix comment.
|
||||||
|
* rtl.c: Fix comment.
|
||||||
|
* symtab.c (symtab_unregister_node): Update.
|
||||||
|
* varpool.c (dump_varpool_node): Update.
|
||||||
|
(varpool_analyze_pending_decls): Update.
|
||||||
|
(assemble_aliases): Update.
|
||||||
|
(varpool_for_node_and_aliases): Update.
|
||||||
|
|
||||||
2012-04-18 Richard Guenther <rguenther@suse.de>
|
2012-04-18 Richard Guenther <rguenther@suse.de>
|
||||||
|
|
||||||
* cfgloop.h (estimate_numbers_of_iterations_loop): Remove
|
* cfgloop.h (estimate_numbers_of_iterations_loop): Remove
|
||||||
|
|
|
||||||
16
gcc/alias.c
16
gcc/alias.c
|
|
@ -1178,7 +1178,7 @@ find_base_value (rtx src)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case TRUNCATE:
|
case TRUNCATE:
|
||||||
/* As we do not know which address space the pointer is refering to, we can
|
/* As we do not know which address space the pointer is referring to, we can
|
||||||
handle this only if the target does not support different pointer or
|
handle this only if the target does not support different pointer or
|
||||||
address modes depending on the address space. */
|
address modes depending on the address space. */
|
||||||
if (!target_default_pointer_address_modes_p ())
|
if (!target_default_pointer_address_modes_p ())
|
||||||
|
|
@ -1197,7 +1197,7 @@ find_base_value (rtx src)
|
||||||
|
|
||||||
case ZERO_EXTEND:
|
case ZERO_EXTEND:
|
||||||
case SIGN_EXTEND: /* used for NT/Alpha pointers */
|
case SIGN_EXTEND: /* used for NT/Alpha pointers */
|
||||||
/* As we do not know which address space the pointer is refering to, we can
|
/* As we do not know which address space the pointer is referring to, we can
|
||||||
handle this only if the target does not support different pointer or
|
handle this only if the target does not support different pointer or
|
||||||
address modes depending on the address space. */
|
address modes depending on the address space. */
|
||||||
if (!target_default_pointer_address_modes_p ())
|
if (!target_default_pointer_address_modes_p ())
|
||||||
|
|
@ -1602,7 +1602,7 @@ find_base_term (rtx x)
|
||||||
return REG_BASE_VALUE (x);
|
return REG_BASE_VALUE (x);
|
||||||
|
|
||||||
case TRUNCATE:
|
case TRUNCATE:
|
||||||
/* As we do not know which address space the pointer is refering to, we can
|
/* As we do not know which address space the pointer is referring to, we can
|
||||||
handle this only if the target does not support different pointer or
|
handle this only if the target does not support different pointer or
|
||||||
address modes depending on the address space. */
|
address modes depending on the address space. */
|
||||||
if (!target_default_pointer_address_modes_p ())
|
if (!target_default_pointer_address_modes_p ())
|
||||||
|
|
@ -1621,7 +1621,7 @@ find_base_term (rtx x)
|
||||||
|
|
||||||
case ZERO_EXTEND:
|
case ZERO_EXTEND:
|
||||||
case SIGN_EXTEND: /* Used for Alpha/NT pointers */
|
case SIGN_EXTEND: /* Used for Alpha/NT pointers */
|
||||||
/* As we do not know which address space the pointer is refering to, we can
|
/* As we do not know which address space the pointer is referring to, we can
|
||||||
handle this only if the target does not support different pointer or
|
handle this only if the target does not support different pointer or
|
||||||
address modes depending on the address space. */
|
address modes depending on the address space. */
|
||||||
if (!target_default_pointer_address_modes_p ())
|
if (!target_default_pointer_address_modes_p ())
|
||||||
|
|
@ -2363,7 +2363,7 @@ nonoverlapping_memrefs_p (const_rtx x, const_rtx y, bool loop_invariant)
|
||||||
&& ! rtx_equal_p (rtlx, rtly))
|
&& ! rtx_equal_p (rtlx, rtly))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* If we have MEMs refering to different address spaces (which can
|
/* If we have MEMs referring to different address spaces (which can
|
||||||
potentially overlap), we cannot easily tell from the addresses
|
potentially overlap), we cannot easily tell from the addresses
|
||||||
whether the references overlap. */
|
whether the references overlap. */
|
||||||
if (MEM_P (rtlx) && MEM_P (rtly)
|
if (MEM_P (rtlx) && MEM_P (rtly)
|
||||||
|
|
@ -2471,7 +2471,7 @@ true_dependence_1 (const_rtx mem, enum machine_mode mem_mode, rtx mem_addr,
|
||||||
if (MEM_READONLY_P (x))
|
if (MEM_READONLY_P (x))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* If we have MEMs refering to different address spaces (which can
|
/* If we have MEMs referring to different address spaces (which can
|
||||||
potentially overlap), we cannot easily tell from the addresses
|
potentially overlap), we cannot easily tell from the addresses
|
||||||
whether the references overlap. */
|
whether the references overlap. */
|
||||||
if (MEM_ADDR_SPACE (mem) != MEM_ADDR_SPACE (x))
|
if (MEM_ADDR_SPACE (mem) != MEM_ADDR_SPACE (x))
|
||||||
|
|
@ -2589,7 +2589,7 @@ write_dependence_p (const_rtx mem, const_rtx x, int writep)
|
||||||
if (!writep && MEM_READONLY_P (mem))
|
if (!writep && MEM_READONLY_P (mem))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* If we have MEMs refering to different address spaces (which can
|
/* If we have MEMs referring to different address spaces (which can
|
||||||
potentially overlap), we cannot easily tell from the addresses
|
potentially overlap), we cannot easily tell from the addresses
|
||||||
whether the references overlap. */
|
whether the references overlap. */
|
||||||
if (MEM_ADDR_SPACE (mem) != MEM_ADDR_SPACE (x))
|
if (MEM_ADDR_SPACE (mem) != MEM_ADDR_SPACE (x))
|
||||||
|
|
@ -2676,7 +2676,7 @@ may_alias_p (const_rtx mem, const_rtx x)
|
||||||
if (MEM_READONLY_P (x))
|
if (MEM_READONLY_P (x))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* If we have MEMs refering to different address spaces (which can
|
/* If we have MEMs referring to different address spaces (which can
|
||||||
potentially overlap), we cannot easily tell from the addresses
|
potentially overlap), we cannot easily tell from the addresses
|
||||||
whether the references overlap. */
|
whether the references overlap. */
|
||||||
if (MEM_ADDR_SPACE (mem) != MEM_ADDR_SPACE (x))
|
if (MEM_ADDR_SPACE (mem) != MEM_ADDR_SPACE (x))
|
||||||
|
|
|
||||||
32
gcc/cgraph.c
32
gcc/cgraph.c
|
|
@ -528,8 +528,8 @@ cgraph_same_body_alias (struct cgraph_node *decl_node ATTRIBUTE_UNUSED, tree ali
|
||||||
n = cgraph_create_function_alias (alias, decl);
|
n = cgraph_create_function_alias (alias, decl);
|
||||||
n->same_body_alias = true;
|
n->same_body_alias = true;
|
||||||
if (same_body_aliases_done)
|
if (same_body_aliases_done)
|
||||||
ipa_record_reference (n, NULL, cgraph_get_node (decl), NULL, IPA_REF_ALIAS,
|
ipa_record_reference ((symtab_node)n, (symtab_node)cgraph_get_node (decl),
|
||||||
NULL);
|
IPA_REF_ALIAS, NULL);
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1927,7 +1927,7 @@ cgraph_clone_node (struct cgraph_node *n, tree decl, gcov_type count, int freq,
|
||||||
for (e = n->indirect_calls; e; e = e->next_callee)
|
for (e = n->indirect_calls; e; e = e->next_callee)
|
||||||
cgraph_clone_edge (e, new_node, e->call_stmt, e->lto_stmt_uid,
|
cgraph_clone_edge (e, new_node, e->call_stmt, e->lto_stmt_uid,
|
||||||
count_scale, freq, update_original);
|
count_scale, freq, update_original);
|
||||||
ipa_clone_references (new_node, NULL, &n->symbol.ref_list);
|
ipa_clone_references ((symtab_node)new_node, &n->symbol.ref_list);
|
||||||
|
|
||||||
new_node->next_sibling_clone = n->clones;
|
new_node->next_sibling_clone = n->clones;
|
||||||
if (n->clones)
|
if (n->clones)
|
||||||
|
|
@ -2023,6 +2023,7 @@ cgraph_create_virtual_clone (struct cgraph_node *old_node,
|
||||||
FOR_EACH_VEC_ELT (ipa_replace_map_p, tree_map, i, map)
|
FOR_EACH_VEC_ELT (ipa_replace_map_p, tree_map, i, map)
|
||||||
{
|
{
|
||||||
tree var = map->new_tree;
|
tree var = map->new_tree;
|
||||||
|
symtab_node ref_node;
|
||||||
|
|
||||||
STRIP_NOPS (var);
|
STRIP_NOPS (var);
|
||||||
if (TREE_CODE (var) != ADDR_EXPR)
|
if (TREE_CODE (var) != ADDR_EXPR)
|
||||||
|
|
@ -2030,19 +2031,16 @@ cgraph_create_virtual_clone (struct cgraph_node *old_node,
|
||||||
var = get_base_var (var);
|
var = get_base_var (var);
|
||||||
if (!var)
|
if (!var)
|
||||||
continue;
|
continue;
|
||||||
|
if (TREE_CODE (var) != FUNCTION_DECL
|
||||||
|
&& TREE_CODE (var) != VAR_DECL)
|
||||||
|
continue;
|
||||||
|
|
||||||
/* Record references of the future statement initializing the constant
|
/* Record references of the future statement initializing the constant
|
||||||
argument. */
|
argument. */
|
||||||
if (TREE_CODE (var) == FUNCTION_DECL)
|
ref_node = symtab_get_node (var);
|
||||||
{
|
gcc_checking_assert (ref_node);
|
||||||
struct cgraph_node *ref_node = cgraph_get_node (var);
|
ipa_record_reference ((symtab_node)new_node, (symtab_node)ref_node,
|
||||||
gcc_checking_assert (ref_node);
|
IPA_REF_ADDR, NULL);
|
||||||
ipa_record_reference (new_node, NULL, ref_node, NULL, IPA_REF_ADDR,
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
else if (TREE_CODE (var) == VAR_DECL)
|
|
||||||
ipa_record_reference (new_node, NULL, NULL, varpool_node (var),
|
|
||||||
IPA_REF_ADDR, NULL);
|
|
||||||
}
|
}
|
||||||
if (!args_to_skip)
|
if (!args_to_skip)
|
||||||
new_node->clone.combined_args_to_skip = old_node->clone.combined_args_to_skip;
|
new_node->clone.combined_args_to_skip = old_node->clone.combined_args_to_skip;
|
||||||
|
|
@ -2249,10 +2247,10 @@ cgraph_for_node_thunks_and_aliases (struct cgraph_node *node,
|
||||||
if (cgraph_for_node_thunks_and_aliases (e->caller, callback, data,
|
if (cgraph_for_node_thunks_and_aliases (e->caller, callback, data,
|
||||||
include_overwritable))
|
include_overwritable))
|
||||||
return true;
|
return true;
|
||||||
for (i = 0; ipa_ref_list_refering_iterate (&node->symbol.ref_list, i, ref); i++)
|
for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list, i, ref); i++)
|
||||||
if (ref->use == IPA_REF_ALIAS)
|
if (ref->use == IPA_REF_ALIAS)
|
||||||
{
|
{
|
||||||
struct cgraph_node *alias = ipa_ref_refering_node (ref);
|
struct cgraph_node *alias = ipa_ref_referring_node (ref);
|
||||||
if (include_overwritable
|
if (include_overwritable
|
||||||
|| cgraph_function_body_availability (alias) > AVAIL_OVERWRITABLE)
|
|| cgraph_function_body_availability (alias) > AVAIL_OVERWRITABLE)
|
||||||
if (cgraph_for_node_thunks_and_aliases (alias, callback, data,
|
if (cgraph_for_node_thunks_and_aliases (alias, callback, data,
|
||||||
|
|
@ -2277,10 +2275,10 @@ cgraph_for_node_and_aliases (struct cgraph_node *node,
|
||||||
|
|
||||||
if (callback (node, data))
|
if (callback (node, data))
|
||||||
return true;
|
return true;
|
||||||
for (i = 0; ipa_ref_list_refering_iterate (&node->symbol.ref_list, i, ref); i++)
|
for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list, i, ref); i++)
|
||||||
if (ref->use == IPA_REF_ALIAS)
|
if (ref->use == IPA_REF_ALIAS)
|
||||||
{
|
{
|
||||||
struct cgraph_node *alias = ipa_ref_refering_node (ref);
|
struct cgraph_node *alias = ipa_ref_referring_node (ref);
|
||||||
if (include_overwritable
|
if (include_overwritable
|
||||||
|| cgraph_function_body_availability (alias) > AVAIL_OVERWRITABLE)
|
|| cgraph_function_body_availability (alias) > AVAIL_OVERWRITABLE)
|
||||||
if (cgraph_for_node_and_aliases (alias, callback, data,
|
if (cgraph_for_node_and_aliases (alias, callback, data,
|
||||||
|
|
|
||||||
|
|
@ -38,10 +38,6 @@ enum symtab_type
|
||||||
SYMTAB_VARIABLE
|
SYMTAB_VARIABLE
|
||||||
};
|
};
|
||||||
|
|
||||||
union symtab_node_def;
|
|
||||||
typedef union symtab_node_def *symtab_node;
|
|
||||||
typedef const union symtab_node_def *const_symtab_node;
|
|
||||||
|
|
||||||
/* Base of all entries in the symbol table.
|
/* Base of all entries in the symbol table.
|
||||||
The symtab_node is inherited by cgraph and varpol nodes. */
|
The symtab_node is inherited by cgraph and varpol nodes. */
|
||||||
struct GTY(()) symtab_node_base
|
struct GTY(()) symtab_node_base
|
||||||
|
|
@ -1166,7 +1162,7 @@ cgraph_alias_aliased_node (struct cgraph_node *n)
|
||||||
|
|
||||||
ipa_ref_list_reference_iterate (&n->symbol.ref_list, 0, ref);
|
ipa_ref_list_reference_iterate (&n->symbol.ref_list, 0, ref);
|
||||||
gcc_checking_assert (ref->use == IPA_REF_ALIAS);
|
gcc_checking_assert (ref->use == IPA_REF_ALIAS);
|
||||||
if (ref->refered_type == IPA_REF_CGRAPH)
|
if (symtab_function_p (ref->referred))
|
||||||
return ipa_ref_node (ref);
|
return ipa_ref_node (ref);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
@ -1180,7 +1176,7 @@ varpool_alias_aliased_node (struct varpool_node *n)
|
||||||
|
|
||||||
ipa_ref_list_reference_iterate (&n->symbol.ref_list, 0, ref);
|
ipa_ref_list_reference_iterate (&n->symbol.ref_list, 0, ref);
|
||||||
gcc_checking_assert (ref->use == IPA_REF_ALIAS);
|
gcc_checking_assert (ref->use == IPA_REF_ALIAS);
|
||||||
if (ref->refered_type == IPA_REF_VARPOOL)
|
if (symtab_variable_p (ref->referred))
|
||||||
return ipa_ref_varpool_node (ref);
|
return ipa_ref_varpool_node (ref);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,8 @@ record_reference (tree *tp, int *walk_subtrees, void *data)
|
||||||
struct cgraph_node *node = cgraph_get_create_node (decl);
|
struct cgraph_node *node = cgraph_get_create_node (decl);
|
||||||
if (!ctx->only_vars)
|
if (!ctx->only_vars)
|
||||||
cgraph_mark_address_taken_node (node);
|
cgraph_mark_address_taken_node (node);
|
||||||
ipa_record_reference (NULL, ctx->varpool_node, node, NULL,
|
ipa_record_reference ((symtab_node)ctx->varpool_node,
|
||||||
|
(symtab_node)node,
|
||||||
IPA_REF_ADDR, NULL);
|
IPA_REF_ADDR, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -87,8 +88,8 @@ record_reference (tree *tp, int *walk_subtrees, void *data)
|
||||||
if (lang_hooks.callgraph.analyze_expr)
|
if (lang_hooks.callgraph.analyze_expr)
|
||||||
lang_hooks.callgraph.analyze_expr (&decl, walk_subtrees);
|
lang_hooks.callgraph.analyze_expr (&decl, walk_subtrees);
|
||||||
varpool_mark_needed_node (vnode);
|
varpool_mark_needed_node (vnode);
|
||||||
ipa_record_reference (NULL, ctx->varpool_node,
|
ipa_record_reference ((symtab_node)ctx->varpool_node,
|
||||||
NULL, vnode,
|
(symtab_node)vnode,
|
||||||
IPA_REF_ADDR, NULL);
|
IPA_REF_ADDR, NULL);
|
||||||
}
|
}
|
||||||
*walk_subtrees = 0;
|
*walk_subtrees = 0;
|
||||||
|
|
@ -130,8 +131,8 @@ record_type_list (struct cgraph_node *node, tree list)
|
||||||
{
|
{
|
||||||
struct varpool_node *vnode = varpool_node (type);
|
struct varpool_node *vnode = varpool_node (type);
|
||||||
varpool_mark_needed_node (vnode);
|
varpool_mark_needed_node (vnode);
|
||||||
ipa_record_reference (node, NULL,
|
ipa_record_reference ((symtab_node)node,
|
||||||
NULL, vnode,
|
(symtab_node)vnode,
|
||||||
IPA_REF_ADDR, NULL);
|
IPA_REF_ADDR, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -151,7 +152,7 @@ record_eh_tables (struct cgraph_node *node, struct function *fun)
|
||||||
struct cgraph_node *per_node;
|
struct cgraph_node *per_node;
|
||||||
|
|
||||||
per_node = cgraph_get_create_node (DECL_FUNCTION_PERSONALITY (node->symbol.decl));
|
per_node = cgraph_get_create_node (DECL_FUNCTION_PERSONALITY (node->symbol.decl));
|
||||||
ipa_record_reference (node, NULL, per_node, NULL, IPA_REF_ADDR, NULL);
|
ipa_record_reference ((symtab_node)node, (symtab_node)per_node, IPA_REF_ADDR, NULL);
|
||||||
cgraph_mark_address_taken_node (per_node);
|
cgraph_mark_address_taken_node (per_node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -232,8 +233,8 @@ mark_address (gimple stmt, tree addr, void *data)
|
||||||
{
|
{
|
||||||
struct cgraph_node *node = cgraph_get_create_node (addr);
|
struct cgraph_node *node = cgraph_get_create_node (addr);
|
||||||
cgraph_mark_address_taken_node (node);
|
cgraph_mark_address_taken_node (node);
|
||||||
ipa_record_reference ((struct cgraph_node *)data, NULL,
|
ipa_record_reference ((symtab_node)data,
|
||||||
node, NULL,
|
(symtab_node)node,
|
||||||
IPA_REF_ADDR, stmt);
|
IPA_REF_ADDR, stmt);
|
||||||
}
|
}
|
||||||
else if (addr && TREE_CODE (addr) == VAR_DECL
|
else if (addr && TREE_CODE (addr) == VAR_DECL
|
||||||
|
|
@ -245,8 +246,8 @@ mark_address (gimple stmt, tree addr, void *data)
|
||||||
if (lang_hooks.callgraph.analyze_expr)
|
if (lang_hooks.callgraph.analyze_expr)
|
||||||
lang_hooks.callgraph.analyze_expr (&addr, &walk_subtrees);
|
lang_hooks.callgraph.analyze_expr (&addr, &walk_subtrees);
|
||||||
varpool_mark_needed_node (vnode);
|
varpool_mark_needed_node (vnode);
|
||||||
ipa_record_reference ((struct cgraph_node *)data, NULL,
|
ipa_record_reference ((symtab_node)data,
|
||||||
NULL, vnode,
|
(symtab_node)vnode,
|
||||||
IPA_REF_ADDR, stmt);
|
IPA_REF_ADDR, stmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -265,8 +266,8 @@ mark_load (gimple stmt, tree t, void *data)
|
||||||
directly manipulated in the code. Pretend that it's an address. */
|
directly manipulated in the code. Pretend that it's an address. */
|
||||||
struct cgraph_node *node = cgraph_get_create_node (t);
|
struct cgraph_node *node = cgraph_get_create_node (t);
|
||||||
cgraph_mark_address_taken_node (node);
|
cgraph_mark_address_taken_node (node);
|
||||||
ipa_record_reference ((struct cgraph_node *)data, NULL,
|
ipa_record_reference ((symtab_node)data,
|
||||||
node, NULL,
|
(symtab_node)node,
|
||||||
IPA_REF_ADDR, stmt);
|
IPA_REF_ADDR, stmt);
|
||||||
}
|
}
|
||||||
else if (t && TREE_CODE (t) == VAR_DECL
|
else if (t && TREE_CODE (t) == VAR_DECL
|
||||||
|
|
@ -278,8 +279,8 @@ mark_load (gimple stmt, tree t, void *data)
|
||||||
if (lang_hooks.callgraph.analyze_expr)
|
if (lang_hooks.callgraph.analyze_expr)
|
||||||
lang_hooks.callgraph.analyze_expr (&t, &walk_subtrees);
|
lang_hooks.callgraph.analyze_expr (&t, &walk_subtrees);
|
||||||
varpool_mark_needed_node (vnode);
|
varpool_mark_needed_node (vnode);
|
||||||
ipa_record_reference ((struct cgraph_node *)data, NULL,
|
ipa_record_reference ((symtab_node)data,
|
||||||
NULL, vnode,
|
(symtab_node)vnode,
|
||||||
IPA_REF_LOAD, stmt);
|
IPA_REF_LOAD, stmt);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -300,8 +301,8 @@ mark_store (gimple stmt, tree t, void *data)
|
||||||
if (lang_hooks.callgraph.analyze_expr)
|
if (lang_hooks.callgraph.analyze_expr)
|
||||||
lang_hooks.callgraph.analyze_expr (&t, &walk_subtrees);
|
lang_hooks.callgraph.analyze_expr (&t, &walk_subtrees);
|
||||||
varpool_mark_needed_node (vnode);
|
varpool_mark_needed_node (vnode);
|
||||||
ipa_record_reference ((struct cgraph_node *)data, NULL,
|
ipa_record_reference ((symtab_node)data,
|
||||||
NULL, vnode,
|
(symtab_node)vnode,
|
||||||
IPA_REF_STORE, stmt);
|
IPA_REF_STORE, stmt);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -348,19 +349,22 @@ build_cgraph_edges (void)
|
||||||
&& gimple_omp_parallel_child_fn (stmt))
|
&& gimple_omp_parallel_child_fn (stmt))
|
||||||
{
|
{
|
||||||
tree fn = gimple_omp_parallel_child_fn (stmt);
|
tree fn = gimple_omp_parallel_child_fn (stmt);
|
||||||
ipa_record_reference (node, NULL, cgraph_get_create_node (fn),
|
ipa_record_reference ((symtab_node)node,
|
||||||
NULL, IPA_REF_ADDR, stmt);
|
(symtab_node)cgraph_get_create_node (fn),
|
||||||
|
IPA_REF_ADDR, stmt);
|
||||||
}
|
}
|
||||||
if (gimple_code (stmt) == GIMPLE_OMP_TASK)
|
if (gimple_code (stmt) == GIMPLE_OMP_TASK)
|
||||||
{
|
{
|
||||||
tree fn = gimple_omp_task_child_fn (stmt);
|
tree fn = gimple_omp_task_child_fn (stmt);
|
||||||
if (fn)
|
if (fn)
|
||||||
ipa_record_reference (node, NULL, cgraph_get_create_node (fn),
|
ipa_record_reference ((symtab_node)node,
|
||||||
NULL, IPA_REF_ADDR, stmt);
|
(symtab_node) cgraph_get_create_node (fn),
|
||||||
|
IPA_REF_ADDR, stmt);
|
||||||
fn = gimple_omp_task_copy_fn (stmt);
|
fn = gimple_omp_task_copy_fn (stmt);
|
||||||
if (fn)
|
if (fn)
|
||||||
ipa_record_reference (node, NULL, cgraph_get_create_node (fn),
|
ipa_record_reference ((symtab_node)node,
|
||||||
NULL, IPA_REF_ADDR, stmt);
|
(symtab_node)cgraph_get_create_node (fn),
|
||||||
|
IPA_REF_ADDR, stmt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (gsi = gsi_start (phi_nodes (bb)); !gsi_end_p (gsi); gsi_next (&gsi))
|
for (gsi = gsi_start (phi_nodes (bb)); !gsi_end_p (gsi); gsi_next (&gsi))
|
||||||
|
|
|
||||||
|
|
@ -930,7 +930,8 @@ cgraph_analyze_function (struct cgraph_node *node)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!VEC_length (ipa_ref_t, node->symbol.ref_list.references))
|
if (!VEC_length (ipa_ref_t, node->symbol.ref_list.references))
|
||||||
ipa_record_reference (node, NULL, tgt, NULL, IPA_REF_ALIAS, NULL);
|
ipa_record_reference ((symtab_node)node, (symtab_node)tgt,
|
||||||
|
IPA_REF_ALIAS, NULL);
|
||||||
if (node->same_body_alias)
|
if (node->same_body_alias)
|
||||||
{
|
{
|
||||||
DECL_VIRTUAL_P (node->symbol.decl) = DECL_VIRTUAL_P (node->thunk.alias);
|
DECL_VIRTUAL_P (node->symbol.decl) = DECL_VIRTUAL_P (node->thunk.alias);
|
||||||
|
|
@ -1031,7 +1032,8 @@ cgraph_process_same_body_aliases (void)
|
||||||
&& !VEC_length (ipa_ref_t, node->symbol.ref_list.references))
|
&& !VEC_length (ipa_ref_t, node->symbol.ref_list.references))
|
||||||
{
|
{
|
||||||
struct cgraph_node *tgt = cgraph_get_node (node->thunk.alias);
|
struct cgraph_node *tgt = cgraph_get_node (node->thunk.alias);
|
||||||
ipa_record_reference (node, NULL, tgt, NULL, IPA_REF_ALIAS, NULL);
|
ipa_record_reference ((symtab_node)node, (symtab_node)tgt,
|
||||||
|
IPA_REF_ALIAS, NULL);
|
||||||
}
|
}
|
||||||
same_body_aliases_done = true;
|
same_body_aliases_done = true;
|
||||||
}
|
}
|
||||||
|
|
@ -1848,11 +1850,11 @@ assemble_thunks_and_aliases (struct cgraph_node *node)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
e = e->next_caller;
|
e = e->next_caller;
|
||||||
for (i = 0; ipa_ref_list_refering_iterate (&node->symbol.ref_list,
|
for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list,
|
||||||
i, ref); i++)
|
i, ref); i++)
|
||||||
if (ref->use == IPA_REF_ALIAS)
|
if (ref->use == IPA_REF_ALIAS)
|
||||||
{
|
{
|
||||||
struct cgraph_node *alias = ipa_ref_refering_node (ref);
|
struct cgraph_node *alias = ipa_ref_referring_node (ref);
|
||||||
bool saved_written = TREE_ASM_WRITTEN (alias->thunk.alias);
|
bool saved_written = TREE_ASM_WRITTEN (alias->thunk.alias);
|
||||||
|
|
||||||
/* Force assemble_alias to really output the alias this time instead
|
/* Force assemble_alias to really output the alias this time instead
|
||||||
|
|
|
||||||
|
|
@ -2622,7 +2622,7 @@ exp_equiv_p (const_rtx x, const_rtx y, int validate, bool for_gcse)
|
||||||
if (GET_MODE (x) != GET_MODE (y))
|
if (GET_MODE (x) != GET_MODE (y))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* MEMs refering to different address space are not equivalent. */
|
/* MEMs referring to different address space are not equivalent. */
|
||||||
if (code == MEM && MEM_ADDR_SPACE (x) != MEM_ADDR_SPACE (y))
|
if (code == MEM && MEM_ADDR_SPACE (x) != MEM_ADDR_SPACE (y))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -957,10 +957,10 @@ reset_edge_caches (struct cgraph_node *node)
|
||||||
for (edge = where->callers; edge; edge = edge->next_caller)
|
for (edge = where->callers; edge; edge = edge->next_caller)
|
||||||
if (edge->inline_failed)
|
if (edge->inline_failed)
|
||||||
reset_edge_growth_cache (edge);
|
reset_edge_growth_cache (edge);
|
||||||
for (i = 0; ipa_ref_list_refering_iterate (&where->symbol.ref_list,
|
for (i = 0; ipa_ref_list_referring_iterate (&where->symbol.ref_list,
|
||||||
i, ref); i++)
|
i, ref); i++)
|
||||||
if (ref->use == IPA_REF_ALIAS)
|
if (ref->use == IPA_REF_ALIAS)
|
||||||
reset_edge_caches (ipa_ref_refering_node (ref));
|
reset_edge_caches (ipa_ref_referring_node (ref));
|
||||||
|
|
||||||
if (!e)
|
if (!e)
|
||||||
return;
|
return;
|
||||||
|
|
@ -1009,11 +1009,11 @@ update_caller_keys (fibheap_t heap, struct cgraph_node *node,
|
||||||
if (!bitmap_set_bit (updated_nodes, node->uid))
|
if (!bitmap_set_bit (updated_nodes, node->uid))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (i = 0; ipa_ref_list_refering_iterate (&node->symbol.ref_list,
|
for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list,
|
||||||
i, ref); i++)
|
i, ref); i++)
|
||||||
if (ref->use == IPA_REF_ALIAS)
|
if (ref->use == IPA_REF_ALIAS)
|
||||||
{
|
{
|
||||||
struct cgraph_node *alias = ipa_ref_refering_node (ref);
|
struct cgraph_node *alias = ipa_ref_referring_node (ref);
|
||||||
update_caller_keys (heap, alias, updated_nodes, check_inlinablity_for);
|
update_caller_keys (heap, alias, updated_nodes, check_inlinablity_for);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ along with GCC; see the file COPYING3. If not see
|
||||||
|
|
||||||
Conditions that are interesting for function body are collected into CONDS
|
Conditions that are interesting for function body are collected into CONDS
|
||||||
vector. They are of simple for function_param OP VAL, where VAL is
|
vector. They are of simple for function_param OP VAL, where VAL is
|
||||||
IPA invariant. The conditions are then refered by predicates. */
|
IPA invariant. The conditions are then referred by predicates. */
|
||||||
|
|
||||||
typedef struct GTY(()) condition
|
typedef struct GTY(()) condition
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -19,61 +19,51 @@ You should have received a copy of the GNU General Public License
|
||||||
along with GCC; see the file COPYING3. If not see
|
along with GCC; see the file COPYING3. If not see
|
||||||
<http://www.gnu.org/licenses/>. */
|
<http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
/* Return callgraph node REF is refering. */
|
/* Return callgraph node REF is referring. */
|
||||||
static inline struct cgraph_node *
|
static inline struct cgraph_node *
|
||||||
ipa_ref_node (struct ipa_ref *ref)
|
ipa_ref_node (struct ipa_ref *ref)
|
||||||
{
|
{
|
||||||
gcc_assert (ref->refered_type == IPA_REF_CGRAPH);
|
return cgraph (ref->referred);
|
||||||
return ref->refered.cgraph_node;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return varpool node REF is refering. */
|
/* Return varpool node REF is referring. */
|
||||||
|
|
||||||
static inline struct varpool_node *
|
static inline struct varpool_node *
|
||||||
ipa_ref_varpool_node (struct ipa_ref *ref)
|
ipa_ref_varpool_node (struct ipa_ref *ref)
|
||||||
{
|
{
|
||||||
gcc_assert (ref->refered_type == IPA_REF_VARPOOL);
|
return varpool (ref->referred);
|
||||||
return ref->refered.varpool_node;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return cgraph node REF is in. */
|
/* Return cgraph node REF is in. */
|
||||||
|
|
||||||
static inline struct cgraph_node *
|
static inline struct cgraph_node *
|
||||||
ipa_ref_refering_node (struct ipa_ref *ref)
|
ipa_ref_referring_node (struct ipa_ref *ref)
|
||||||
{
|
{
|
||||||
gcc_assert (ref->refering_type == IPA_REF_CGRAPH);
|
return cgraph (ref->referring);
|
||||||
return ref->refering.cgraph_node;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return varpool node REF is in. */
|
/* Return varpool node REF is in. */
|
||||||
|
|
||||||
static inline struct varpool_node *
|
static inline struct varpool_node *
|
||||||
ipa_ref_refering_varpool_node (struct ipa_ref *ref)
|
ipa_ref_referring_varpool_node (struct ipa_ref *ref)
|
||||||
{
|
{
|
||||||
gcc_assert (ref->refering_type == IPA_REF_VARPOOL);
|
return varpool (ref->referring);
|
||||||
return ref->refering.varpool_node;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return reference list REF is in. */
|
/* Return reference list REF is in. */
|
||||||
|
|
||||||
static inline struct ipa_ref_list *
|
static inline struct ipa_ref_list *
|
||||||
ipa_ref_refering_ref_list (struct ipa_ref *ref)
|
ipa_ref_referring_ref_list (struct ipa_ref *ref)
|
||||||
{
|
{
|
||||||
if (ref->refering_type == IPA_REF_CGRAPH)
|
return &ref->referring->symbol.ref_list;
|
||||||
return &ipa_ref_refering_node (ref)->symbol.ref_list;
|
|
||||||
else
|
|
||||||
return &ipa_ref_refering_varpool_node (ref)->symbol.ref_list;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return reference list REF is in. */
|
/* Return reference list REF is in. */
|
||||||
|
|
||||||
static inline struct ipa_ref_list *
|
static inline struct ipa_ref_list *
|
||||||
ipa_ref_refered_ref_list (struct ipa_ref *ref)
|
ipa_ref_referred_ref_list (struct ipa_ref *ref)
|
||||||
{
|
{
|
||||||
if (ref->refered_type == IPA_REF_CGRAPH)
|
return &ref->referred->symbol.ref_list;
|
||||||
return &ipa_ref_node (ref)->symbol.ref_list;
|
|
||||||
else
|
|
||||||
return &ipa_ref_varpool_node (ref)->symbol.ref_list;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return first reference in LIST or NULL if empty. */
|
/* Return first reference in LIST or NULL if empty. */
|
||||||
|
|
@ -86,14 +76,14 @@ ipa_ref_list_first_reference (struct ipa_ref_list *list)
|
||||||
return VEC_index (ipa_ref_t, list->references, 0);
|
return VEC_index (ipa_ref_t, list->references, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return first refering ref in LIST or NULL if empty. */
|
/* Return first referring ref in LIST or NULL if empty. */
|
||||||
|
|
||||||
static inline struct ipa_ref *
|
static inline struct ipa_ref *
|
||||||
ipa_ref_list_first_refering (struct ipa_ref_list *list)
|
ipa_ref_list_first_referring (struct ipa_ref_list *list)
|
||||||
{
|
{
|
||||||
if (!VEC_length (ipa_ref_ptr, list->refering))
|
if (!VEC_length (ipa_ref_ptr, list->referring))
|
||||||
return NULL;
|
return NULL;
|
||||||
return VEC_index (ipa_ref_ptr, list->refering, 0);
|
return VEC_index (ipa_ref_ptr, list->referring, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clear reference list. */
|
/* Clear reference list. */
|
||||||
|
|
@ -101,7 +91,7 @@ ipa_ref_list_first_refering (struct ipa_ref_list *list)
|
||||||
static inline void
|
static inline void
|
||||||
ipa_empty_ref_list (struct ipa_ref_list *list)
|
ipa_empty_ref_list (struct ipa_ref_list *list)
|
||||||
{
|
{
|
||||||
list->refering = NULL;
|
list->referring = NULL;
|
||||||
list->references = NULL;
|
list->references = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -115,5 +105,5 @@ ipa_ref_list_nreferences (struct ipa_ref_list *list)
|
||||||
|
|
||||||
#define ipa_ref_list_reference_iterate(L,I,P) \
|
#define ipa_ref_list_reference_iterate(L,I,P) \
|
||||||
VEC_iterate(ipa_ref_t, (L)->references, (I), (P))
|
VEC_iterate(ipa_ref_t, (L)->references, (I), (P))
|
||||||
#define ipa_ref_list_refering_iterate(L,I,P) \
|
#define ipa_ref_list_referring_iterate(L,I,P) \
|
||||||
VEC_iterate(ipa_ref_ptr, (L)->refering, (I), (P))
|
VEC_iterate(ipa_ref_ptr, (L)->referring, (I), (P))
|
||||||
|
|
|
||||||
152
gcc/ipa-ref.c
152
gcc/ipa-ref.c
|
|
@ -1,5 +1,5 @@
|
||||||
/* Interprocedural reference lists.
|
/* Interprocedural reference lists.
|
||||||
Copyright (C) 2010
|
Copyright (C) 2010, 2011, 2012
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
Contributed by Jan Hubicka
|
Contributed by Jan Hubicka
|
||||||
|
|
||||||
|
|
@ -34,54 +34,28 @@ static const char *ipa_ref_use_name[] = {"read","write","addr","alias"};
|
||||||
of the use and STMT the statement (if it exists). */
|
of the use and STMT the statement (if it exists). */
|
||||||
|
|
||||||
struct ipa_ref *
|
struct ipa_ref *
|
||||||
ipa_record_reference (struct cgraph_node *refering_node,
|
ipa_record_reference (symtab_node referring_node,
|
||||||
struct varpool_node *refering_varpool_node,
|
symtab_node referred_node,
|
||||||
struct cgraph_node *refered_node,
|
|
||||||
struct varpool_node *refered_varpool_node,
|
|
||||||
enum ipa_ref_use use_type, gimple stmt)
|
enum ipa_ref_use use_type, gimple stmt)
|
||||||
{
|
{
|
||||||
struct ipa_ref *ref;
|
struct ipa_ref *ref;
|
||||||
struct ipa_ref_list *list, *list2;
|
struct ipa_ref_list *list, *list2;
|
||||||
VEC(ipa_ref_t,gc) *old_references;
|
VEC(ipa_ref_t,gc) *old_references;
|
||||||
gcc_assert ((!refering_node) ^ (!refering_varpool_node));
|
|
||||||
gcc_assert ((!refered_node) ^ (!refered_varpool_node));
|
|
||||||
gcc_assert (!stmt || refering_node);
|
|
||||||
gcc_assert (use_type != IPA_REF_ALIAS || !stmt);
|
|
||||||
|
|
||||||
list = (refering_node ? &refering_node->symbol.ref_list
|
gcc_checking_assert (!stmt || symtab_function_p (referring_node));
|
||||||
: &refering_varpool_node->symbol.ref_list);
|
gcc_checking_assert (use_type != IPA_REF_ALIAS || !stmt);
|
||||||
|
|
||||||
|
list = &referring_node->symbol.ref_list;
|
||||||
old_references = list->references;
|
old_references = list->references;
|
||||||
VEC_safe_grow (ipa_ref_t, gc, list->references,
|
VEC_safe_grow (ipa_ref_t, gc, list->references,
|
||||||
VEC_length (ipa_ref_t, list->references) + 1);
|
VEC_length (ipa_ref_t, list->references) + 1);
|
||||||
ref = VEC_last (ipa_ref_t, list->references);
|
ref = VEC_last (ipa_ref_t, list->references);
|
||||||
|
|
||||||
list2 = (refered_node ? &refered_node->symbol.ref_list
|
list2 = &referred_node->symbol.ref_list;
|
||||||
: &refered_varpool_node->symbol.ref_list);
|
VEC_safe_push (ipa_ref_ptr, heap, list2->referring, ref);
|
||||||
VEC_safe_push (ipa_ref_ptr, heap, list2->refering, ref);
|
ref->referred_index = VEC_length (ipa_ref_ptr, list2->referring) - 1;
|
||||||
ref->refered_index = VEC_length (ipa_ref_ptr, list2->refering) - 1;
|
ref->referring = referring_node;
|
||||||
if (refering_node)
|
ref->referred = referred_node;
|
||||||
{
|
|
||||||
ref->refering.cgraph_node = refering_node;
|
|
||||||
ref->refering_type = IPA_REF_CGRAPH;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ref->refering.varpool_node = refering_varpool_node;
|
|
||||||
ref->refering_type = IPA_REF_VARPOOL;
|
|
||||||
gcc_assert (use_type == IPA_REF_ADDR || use_type == IPA_REF_ALIAS);
|
|
||||||
}
|
|
||||||
if (refered_node)
|
|
||||||
{
|
|
||||||
ref->refered.cgraph_node = refered_node;
|
|
||||||
ref->refered_type = IPA_REF_CGRAPH;
|
|
||||||
gcc_assert (use_type == IPA_REF_ADDR || use_type == IPA_REF_ALIAS);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
varpool_mark_needed_node (refered_varpool_node);
|
|
||||||
ref->refered.varpool_node = refered_varpool_node;
|
|
||||||
ref->refered_type = IPA_REF_VARPOOL;
|
|
||||||
}
|
|
||||||
ref->stmt = stmt;
|
ref->stmt = stmt;
|
||||||
ref->use = use_type;
|
ref->use = use_type;
|
||||||
|
|
||||||
|
|
@ -91,8 +65,8 @@ ipa_record_reference (struct cgraph_node *refering_node,
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; ipa_ref_list_reference_iterate (list, i, ref); i++)
|
for (i = 0; ipa_ref_list_reference_iterate (list, i, ref); i++)
|
||||||
VEC_replace (ipa_ref_ptr,
|
VEC_replace (ipa_ref_ptr,
|
||||||
ipa_ref_refered_ref_list (ref)->refering,
|
ipa_ref_referred_ref_list (ref)->referring,
|
||||||
ref->refered_index, ref);
|
ref->referred_index, ref);
|
||||||
}
|
}
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
|
@ -102,30 +76,30 @@ ipa_record_reference (struct cgraph_node *refering_node,
|
||||||
void
|
void
|
||||||
ipa_remove_reference (struct ipa_ref *ref)
|
ipa_remove_reference (struct ipa_ref *ref)
|
||||||
{
|
{
|
||||||
struct ipa_ref_list *list = ipa_ref_refered_ref_list (ref);
|
struct ipa_ref_list *list = ipa_ref_referred_ref_list (ref);
|
||||||
struct ipa_ref_list *list2 = ipa_ref_refering_ref_list (ref);
|
struct ipa_ref_list *list2 = ipa_ref_referring_ref_list (ref);
|
||||||
VEC(ipa_ref_t,gc) *old_references = list2->references;
|
VEC(ipa_ref_t,gc) *old_references = list2->references;
|
||||||
struct ipa_ref *last;
|
struct ipa_ref *last;
|
||||||
|
|
||||||
gcc_assert (VEC_index (ipa_ref_ptr, list->refering, ref->refered_index) == ref);
|
gcc_assert (VEC_index (ipa_ref_ptr, list->referring, ref->referred_index) == ref);
|
||||||
last = VEC_last (ipa_ref_ptr, list->refering);
|
last = VEC_last (ipa_ref_ptr, list->referring);
|
||||||
if (ref != last)
|
if (ref != last)
|
||||||
{
|
{
|
||||||
VEC_replace (ipa_ref_ptr, list->refering,
|
VEC_replace (ipa_ref_ptr, list->referring,
|
||||||
ref->refered_index,
|
ref->referred_index,
|
||||||
VEC_last (ipa_ref_ptr, list->refering));
|
VEC_last (ipa_ref_ptr, list->referring));
|
||||||
VEC_index (ipa_ref_ptr, list->refering,
|
VEC_index (ipa_ref_ptr, list->referring,
|
||||||
ref->refered_index)->refered_index = ref->refered_index;
|
ref->referred_index)->referred_index = ref->referred_index;
|
||||||
}
|
}
|
||||||
VEC_pop (ipa_ref_ptr, list->refering);
|
VEC_pop (ipa_ref_ptr, list->referring);
|
||||||
|
|
||||||
last = VEC_last (ipa_ref_t, list2->references);
|
last = VEC_last (ipa_ref_t, list2->references);
|
||||||
if (ref != last)
|
if (ref != last)
|
||||||
{
|
{
|
||||||
*ref = *last;
|
*ref = *last;
|
||||||
VEC_replace (ipa_ref_ptr,
|
VEC_replace (ipa_ref_ptr,
|
||||||
ipa_ref_refered_ref_list (ref)->refering,
|
ipa_ref_referred_ref_list (ref)->referring,
|
||||||
ref->refered_index, ref);
|
ref->referred_index, ref);
|
||||||
}
|
}
|
||||||
VEC_pop (ipa_ref_t, list2->references);
|
VEC_pop (ipa_ref_t, list2->references);
|
||||||
gcc_assert (list2->references == old_references);
|
gcc_assert (list2->references == old_references);
|
||||||
|
|
@ -145,12 +119,12 @@ ipa_remove_all_references (struct ipa_ref_list *list)
|
||||||
/* Remove all references in ref list LIST. */
|
/* Remove all references in ref list LIST. */
|
||||||
|
|
||||||
void
|
void
|
||||||
ipa_remove_all_refering (struct ipa_ref_list *list)
|
ipa_remove_all_referring (struct ipa_ref_list *list)
|
||||||
{
|
{
|
||||||
while (VEC_length (ipa_ref_ptr, list->refering))
|
while (VEC_length (ipa_ref_ptr, list->referring))
|
||||||
ipa_remove_reference (VEC_last (ipa_ref_ptr, list->refering));
|
ipa_remove_reference (VEC_last (ipa_ref_ptr, list->referring));
|
||||||
VEC_free (ipa_ref_ptr, heap, list->refering);
|
VEC_free (ipa_ref_ptr, heap, list->referring);
|
||||||
list->refering = NULL;
|
list->referring = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Dump references in LIST to FILE. */
|
/* Dump references in LIST to FILE. */
|
||||||
|
|
@ -162,38 +136,27 @@ ipa_dump_references (FILE * file, struct ipa_ref_list *list)
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; ipa_ref_list_reference_iterate (list, i, ref); i++)
|
for (i = 0; ipa_ref_list_reference_iterate (list, i, ref); i++)
|
||||||
{
|
{
|
||||||
if (ref->refered_type == IPA_REF_CGRAPH)
|
fprintf (file, "%s/%i (%s)",
|
||||||
{
|
symtab_node_asm_name (ref->referred),
|
||||||
fprintf (file, " fn:%s/%i (%s)", cgraph_node_asm_name (ipa_ref_node (ref)),
|
ref->referred->symbol.order,
|
||||||
ipa_ref_node (ref)->symbol.order,
|
ipa_ref_use_name [ref->use]);
|
||||||
ipa_ref_use_name [ref->use]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
fprintf (file, " var:%s (%s)",
|
|
||||||
varpool_node_asm_name (ipa_ref_varpool_node (ref)),
|
|
||||||
ipa_ref_use_name [ref->use]);
|
|
||||||
}
|
}
|
||||||
fprintf (file, "\n");
|
fprintf (file, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Dump refering in LIST to FILE. */
|
/* Dump referring in LIST to FILE. */
|
||||||
|
|
||||||
void
|
void
|
||||||
ipa_dump_refering (FILE * file, struct ipa_ref_list *list)
|
ipa_dump_referring (FILE * file, struct ipa_ref_list *list)
|
||||||
{
|
{
|
||||||
struct ipa_ref *ref;
|
struct ipa_ref *ref;
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; ipa_ref_list_refering_iterate (list, i, ref); i++)
|
for (i = 0; ipa_ref_list_referring_iterate (list, i, ref); i++)
|
||||||
{
|
{
|
||||||
if (ref->refering_type == IPA_REF_CGRAPH)
|
fprintf (file, "%s/%i (%s)",
|
||||||
fprintf (file, " fn:%s/%i (%s)",
|
symtab_node_asm_name (ref->referring),
|
||||||
cgraph_node_asm_name (ipa_ref_refering_node (ref)),
|
ref->referring->symbol.order,
|
||||||
ipa_ref_refering_node (ref)->symbol.order,
|
ipa_ref_use_name [ref->use]);
|
||||||
ipa_ref_use_name [ref->use]);
|
|
||||||
else
|
|
||||||
fprintf (file, " var:%s (%s)",
|
|
||||||
varpool_node_asm_name (ipa_ref_refering_varpool_node (ref)),
|
|
||||||
ipa_ref_use_name [ref->use]);
|
|
||||||
}
|
}
|
||||||
fprintf (file, "\n");
|
fprintf (file, "\n");
|
||||||
}
|
}
|
||||||
|
|
@ -201,46 +164,37 @@ ipa_dump_refering (FILE * file, struct ipa_ref_list *list)
|
||||||
/* Clone all references from SRC to DEST_NODE or DEST_VARPOOL_NODE. */
|
/* Clone all references from SRC to DEST_NODE or DEST_VARPOOL_NODE. */
|
||||||
|
|
||||||
void
|
void
|
||||||
ipa_clone_references (struct cgraph_node *dest_node,
|
ipa_clone_references (symtab_node dest_node,
|
||||||
struct varpool_node *dest_varpool_node,
|
|
||||||
struct ipa_ref_list *src)
|
struct ipa_ref_list *src)
|
||||||
{
|
{
|
||||||
struct ipa_ref *ref;
|
struct ipa_ref *ref;
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; ipa_ref_list_reference_iterate (src, i, ref); i++)
|
for (i = 0; ipa_ref_list_reference_iterate (src, i, ref); i++)
|
||||||
ipa_record_reference (dest_node, dest_varpool_node,
|
ipa_record_reference (dest_node,
|
||||||
ref->refered_type == IPA_REF_CGRAPH
|
ref->referred,
|
||||||
? ipa_ref_node (ref) : NULL,
|
|
||||||
ref->refered_type == IPA_REF_VARPOOL
|
|
||||||
? ipa_ref_varpool_node (ref) : NULL,
|
|
||||||
ref->use, ref->stmt);
|
ref->use, ref->stmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clone all refering from SRC to DEST_NODE or DEST_VARPOOL_NODE. */
|
/* Clone all referring from SRC to DEST_NODE or DEST_VARPOOL_NODE. */
|
||||||
|
|
||||||
void
|
void
|
||||||
ipa_clone_refering (struct cgraph_node *dest_node,
|
ipa_clone_referring (symtab_node dest_node,
|
||||||
struct varpool_node *dest_varpool_node,
|
|
||||||
struct ipa_ref_list *src)
|
struct ipa_ref_list *src)
|
||||||
{
|
{
|
||||||
struct ipa_ref *ref;
|
struct ipa_ref *ref;
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; ipa_ref_list_refering_iterate (src, i, ref); i++)
|
for (i = 0; ipa_ref_list_referring_iterate (src, i, ref); i++)
|
||||||
ipa_record_reference (
|
ipa_record_reference (ref->referring,
|
||||||
ref->refering_type == IPA_REF_CGRAPH
|
dest_node,
|
||||||
? ipa_ref_refering_node (ref) : NULL,
|
|
||||||
ref->refering_type == IPA_REF_VARPOOL
|
|
||||||
? ipa_ref_refering_varpool_node (ref) : NULL,
|
|
||||||
dest_node, dest_varpool_node,
|
|
||||||
ref->use, ref->stmt);
|
ref->use, ref->stmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return true when execution of REF can load to return from
|
/* Return true when execution of REF can lead to return from
|
||||||
function. */
|
function. */
|
||||||
bool
|
bool
|
||||||
ipa_ref_cannot_lead_to_return (struct ipa_ref *ref)
|
ipa_ref_cannot_lead_to_return (struct ipa_ref *ref)
|
||||||
{
|
{
|
||||||
return cgraph_node_cannot_return (ipa_ref_refering_node (ref));
|
return cgraph_node_cannot_return (ipa_ref_referring_node (ref));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return true if list contains an alias. */
|
/* Return true if list contains an alias. */
|
||||||
|
|
@ -249,7 +203,7 @@ ipa_ref_has_aliases_p (struct ipa_ref_list *ref_list)
|
||||||
{
|
{
|
||||||
struct ipa_ref *ref;
|
struct ipa_ref *ref;
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; ipa_ref_list_refering_iterate (ref_list, i, ref); i++)
|
for (i = 0; ipa_ref_list_referring_iterate (ref_list, i, ref); i++)
|
||||||
if (ref->use == IPA_REF_ALIAS)
|
if (ref->use == IPA_REF_ALIAS)
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,10 @@ along with GCC; see the file COPYING3. If not see
|
||||||
|
|
||||||
struct cgraph_node;
|
struct cgraph_node;
|
||||||
struct varpool_node;
|
struct varpool_node;
|
||||||
|
union symtab_node_def;
|
||||||
|
typedef union symtab_node_def *symtab_node;
|
||||||
|
typedef const union symtab_node_def *const_symtab_node;
|
||||||
|
|
||||||
|
|
||||||
/* How the reference is done. */
|
/* How the reference is done. */
|
||||||
enum GTY(()) ipa_ref_use
|
enum GTY(()) ipa_ref_use
|
||||||
|
|
@ -31,30 +35,13 @@ enum GTY(()) ipa_ref_use
|
||||||
IPA_REF_ALIAS
|
IPA_REF_ALIAS
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Type of refering or refered type. */
|
|
||||||
enum GTY(()) ipa_ref_type
|
|
||||||
{
|
|
||||||
IPA_REF_CGRAPH,
|
|
||||||
IPA_REF_VARPOOL
|
|
||||||
};
|
|
||||||
|
|
||||||
/* We can have references spanning both callgraph and varpool,
|
|
||||||
so all pointers needs to be of both types. */
|
|
||||||
union GTY(()) ipa_ref_ptr_u
|
|
||||||
{
|
|
||||||
struct cgraph_node * GTY((tag ("IPA_REF_CGRAPH"))) cgraph_node;
|
|
||||||
struct varpool_node * GTY((tag ("IPA_REF_VARPOOL"))) varpool_node;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Record of reference in callgraph or varpool. */
|
/* Record of reference in callgraph or varpool. */
|
||||||
struct GTY(()) ipa_ref
|
struct GTY(()) ipa_ref
|
||||||
{
|
{
|
||||||
union ipa_ref_ptr_u GTY ((desc ("%1.refering_type"))) refering;
|
symtab_node referring;
|
||||||
union ipa_ref_ptr_u GTY ((desc ("%1.refered_type"))) refered;
|
symtab_node referred;
|
||||||
gimple stmt;
|
gimple stmt;
|
||||||
unsigned int refered_index;
|
unsigned int referred_index;
|
||||||
ENUM_BITFIELD (ipa_ref_type) refering_type:1;
|
|
||||||
ENUM_BITFIELD (ipa_ref_type) refered_type:1;
|
|
||||||
ENUM_BITFIELD (ipa_ref_use) use:2;
|
ENUM_BITFIELD (ipa_ref_use) use:2;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -73,21 +60,19 @@ struct GTY(()) ipa_ref_list
|
||||||
VEC(ipa_ref_t,gc) *references;
|
VEC(ipa_ref_t,gc) *references;
|
||||||
/* Refering is vector of pointers to references. It must not live in GGC space
|
/* Refering is vector of pointers to references. It must not live in GGC space
|
||||||
or GGC will try to mark middle of references vectors. */
|
or GGC will try to mark middle of references vectors. */
|
||||||
VEC(ipa_ref_ptr,heap) * GTY((skip)) refering;
|
VEC(ipa_ref_ptr,heap) * GTY((skip)) referring;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ipa_ref * ipa_record_reference (struct cgraph_node *,
|
struct ipa_ref * ipa_record_reference (symtab_node,
|
||||||
struct varpool_node *,
|
symtab_node,
|
||||||
struct cgraph_node *,
|
|
||||||
struct varpool_node *,
|
|
||||||
enum ipa_ref_use, gimple);
|
enum ipa_ref_use, gimple);
|
||||||
|
|
||||||
void ipa_remove_reference (struct ipa_ref *);
|
void ipa_remove_reference (struct ipa_ref *);
|
||||||
void ipa_remove_all_references (struct ipa_ref_list *);
|
void ipa_remove_all_references (struct ipa_ref_list *);
|
||||||
void ipa_remove_all_refering (struct ipa_ref_list *);
|
void ipa_remove_all_referring (struct ipa_ref_list *);
|
||||||
void ipa_dump_references (FILE *, struct ipa_ref_list *);
|
void ipa_dump_references (FILE *, struct ipa_ref_list *);
|
||||||
void ipa_dump_refering (FILE *, struct ipa_ref_list *);
|
void ipa_dump_referring (FILE *, struct ipa_ref_list *);
|
||||||
void ipa_clone_references (struct cgraph_node *, struct varpool_node *, struct ipa_ref_list *);
|
void ipa_clone_references (symtab_node, struct ipa_ref_list *);
|
||||||
void ipa_clone_refering (struct cgraph_node *, struct varpool_node *, struct ipa_ref_list *);
|
void ipa_clone_referring (symtab_node, struct ipa_ref_list *);
|
||||||
bool ipa_ref_cannot_lead_to_return (struct ipa_ref *);
|
bool ipa_ref_cannot_lead_to_return (struct ipa_ref *);
|
||||||
bool ipa_ref_has_aliases_p (struct ipa_ref_list *);
|
bool ipa_ref_has_aliases_p (struct ipa_ref_list *);
|
||||||
|
|
|
||||||
|
|
@ -435,7 +435,7 @@ analyze_function (struct cgraph_node *fn)
|
||||||
local = init_function_info (fn);
|
local = init_function_info (fn);
|
||||||
for (i = 0; ipa_ref_list_reference_iterate (&fn->symbol.ref_list, i, ref); i++)
|
for (i = 0; ipa_ref_list_reference_iterate (&fn->symbol.ref_list, i, ref); i++)
|
||||||
{
|
{
|
||||||
if (ref->refered_type != IPA_REF_VARPOOL)
|
if (!symtab_variable_p (ref->referred))
|
||||||
continue;
|
continue;
|
||||||
var = ipa_ref_varpool_node (ref)->symbol.decl;
|
var = ipa_ref_varpool_node (ref)->symbol.decl;
|
||||||
if (ipa_ref_varpool_node (ref)->symbol.externally_visible
|
if (ipa_ref_varpool_node (ref)->symbol.externally_visible
|
||||||
|
|
|
||||||
|
|
@ -295,13 +295,13 @@ ipa_reverse_postorder (struct cgraph_node **order)
|
||||||
(cgraph_function_node (edge->callee, NULL)->symbol.decl))
|
(cgraph_function_node (edge->callee, NULL)->symbol.decl))
|
||||||
node2 = NULL;
|
node2 = NULL;
|
||||||
}
|
}
|
||||||
for (;ipa_ref_list_refering_iterate (&stack[stack_size].node->symbol.ref_list,
|
for (;ipa_ref_list_referring_iterate (&stack[stack_size].node->symbol.ref_list,
|
||||||
stack[stack_size].ref,
|
stack[stack_size].ref,
|
||||||
ref) && !node2;
|
ref) && !node2;
|
||||||
stack[stack_size].ref++)
|
stack[stack_size].ref++)
|
||||||
{
|
{
|
||||||
if (ref->use == IPA_REF_ALIAS)
|
if (ref->use == IPA_REF_ALIAS)
|
||||||
node2 = ipa_ref_refering_node (ref);
|
node2 = ipa_ref_referring_node (ref);
|
||||||
}
|
}
|
||||||
if (!node2)
|
if (!node2)
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
22
gcc/ipa.c
22
gcc/ipa.c
|
|
@ -91,7 +91,7 @@ process_references (struct ipa_ref_list *list,
|
||||||
struct ipa_ref *ref;
|
struct ipa_ref *ref;
|
||||||
for (i = 0; ipa_ref_list_reference_iterate (list, i, ref); i++)
|
for (i = 0; ipa_ref_list_reference_iterate (list, i, ref); i++)
|
||||||
{
|
{
|
||||||
if (ref->refered_type == IPA_REF_CGRAPH)
|
if (symtab_function_p (ref->referred))
|
||||||
{
|
{
|
||||||
struct cgraph_node *node = ipa_ref_node (ref);
|
struct cgraph_node *node = ipa_ref_node (ref);
|
||||||
if (!node->reachable
|
if (!node->reachable
|
||||||
|
|
@ -154,7 +154,7 @@ has_addr_references_p (struct cgraph_node *node,
|
||||||
int i;
|
int i;
|
||||||
struct ipa_ref *ref;
|
struct ipa_ref *ref;
|
||||||
|
|
||||||
for (i = 0; ipa_ref_list_refering_iterate (&node->symbol.ref_list,
|
for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list,
|
||||||
i, ref); i++)
|
i, ref); i++)
|
||||||
if (ref->use == IPA_REF_ADDR)
|
if (ref->use == IPA_REF_ADDR)
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -352,14 +352,14 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
|
||||||
for (e = node->callers; e && !found; e = e->next_caller)
|
for (e = node->callers; e && !found; e = e->next_caller)
|
||||||
if (e->caller->reachable)
|
if (e->caller->reachable)
|
||||||
found = true;
|
found = true;
|
||||||
for (i = 0; (ipa_ref_list_refering_iterate (&node->symbol.ref_list,
|
for (i = 0; (ipa_ref_list_referring_iterate (&node->symbol.ref_list,
|
||||||
i, ref)
|
i, ref)
|
||||||
&& !found); i++)
|
&& !found); i++)
|
||||||
if (ref->refering_type == IPA_REF_CGRAPH
|
if (symtab_function_p (ref->referring)
|
||||||
&& ipa_ref_refering_node (ref)->reachable)
|
&& ipa_ref_referring_node (ref)->reachable)
|
||||||
found = true;
|
found = true;
|
||||||
else if (ref->refering_type == IPA_REF_VARPOOL
|
else if (symtab_variable_p (ref->referring)
|
||||||
&& ipa_ref_refering_varpool_node (ref)->needed)
|
&& ipa_ref_referring_varpool_node (ref)->needed)
|
||||||
found = true;
|
found = true;
|
||||||
|
|
||||||
/* If so, we need to keep node in the callgraph. */
|
/* If so, we need to keep node in the callgraph. */
|
||||||
|
|
@ -501,7 +501,7 @@ ipa_discover_readonly_nonaddressable_vars (void)
|
||||||
bool address_taken = false;
|
bool address_taken = false;
|
||||||
int i;
|
int i;
|
||||||
struct ipa_ref *ref;
|
struct ipa_ref *ref;
|
||||||
for (i = 0; ipa_ref_list_refering_iterate (&vnode->symbol.ref_list,
|
for (i = 0; ipa_ref_list_referring_iterate (&vnode->symbol.ref_list,
|
||||||
i, ref)
|
i, ref)
|
||||||
&& (!written || !address_taken); i++)
|
&& (!written || !address_taken); i++)
|
||||||
switch (ref->use)
|
switch (ref->use)
|
||||||
|
|
@ -542,14 +542,14 @@ cgraph_address_taken_from_non_vtable_p (struct cgraph_node *node)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct ipa_ref *ref;
|
struct ipa_ref *ref;
|
||||||
for (i = 0; ipa_ref_list_refering_iterate (&node->symbol.ref_list,
|
for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list,
|
||||||
i, ref); i++)
|
i, ref); i++)
|
||||||
if (ref->use == IPA_REF_ADDR)
|
if (ref->use == IPA_REF_ADDR)
|
||||||
{
|
{
|
||||||
struct varpool_node *node;
|
struct varpool_node *node;
|
||||||
if (ref->refering_type == IPA_REF_CGRAPH)
|
if (symtab_function_p (ref->referring))
|
||||||
return true;
|
return true;
|
||||||
node = ipa_ref_refering_varpool_node (ref);
|
node = ipa_ref_referring_varpool_node (ref);
|
||||||
if (!DECL_VIRTUAL_P (node->symbol.decl))
|
if (!DECL_VIRTUAL_P (node->symbol.decl))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1764,7 +1764,7 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y)
|
||||||
if (GET_MODE (x) != GET_MODE (y))
|
if (GET_MODE (x) != GET_MODE (y))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* MEMs refering to different address space are not equivalent. */
|
/* MEMs referring to different address space are not equivalent. */
|
||||||
if (code == MEM && MEM_ADDR_SPACE (x) != MEM_ADDR_SPACE (y))
|
if (code == MEM && MEM_ADDR_SPACE (x) != MEM_ADDR_SPACE (y))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -326,18 +326,18 @@ referenced_from_other_partition_p (struct ipa_ref_list *list, cgraph_node_set se
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct ipa_ref *ref;
|
struct ipa_ref *ref;
|
||||||
for (i = 0; ipa_ref_list_refering_iterate (list, i, ref); i++)
|
for (i = 0; ipa_ref_list_referring_iterate (list, i, ref); i++)
|
||||||
{
|
{
|
||||||
if (ref->refering_type == IPA_REF_CGRAPH)
|
if (symtab_function_p (ref->referring))
|
||||||
{
|
{
|
||||||
if (ipa_ref_refering_node (ref)->symbol.in_other_partition
|
if (ipa_ref_referring_node (ref)->symbol.in_other_partition
|
||||||
|| !cgraph_node_in_set_p (ipa_ref_refering_node (ref), set))
|
|| !cgraph_node_in_set_p (ipa_ref_referring_node (ref), set))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (ipa_ref_refering_varpool_node (ref)->symbol.in_other_partition
|
if (ipa_ref_referring_varpool_node (ref)->symbol.in_other_partition
|
||||||
|| !varpool_node_in_set_p (ipa_ref_refering_varpool_node (ref),
|
|| !varpool_node_in_set_p (ipa_ref_referring_varpool_node (ref),
|
||||||
vset))
|
vset))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -370,16 +370,16 @@ referenced_from_this_partition_p (struct ipa_ref_list *list, cgraph_node_set set
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct ipa_ref *ref;
|
struct ipa_ref *ref;
|
||||||
for (i = 0; ipa_ref_list_refering_iterate (list, i, ref); i++)
|
for (i = 0; ipa_ref_list_referring_iterate (list, i, ref); i++)
|
||||||
{
|
{
|
||||||
if (ref->refering_type == IPA_REF_CGRAPH)
|
if (symtab_function_p (ref->referring))
|
||||||
{
|
{
|
||||||
if (cgraph_node_in_set_p (ipa_ref_refering_node (ref), set))
|
if (cgraph_node_in_set_p (ipa_ref_referring_node (ref), set))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (varpool_node_in_set_p (ipa_ref_refering_varpool_node (ref),
|
if (varpool_node_in_set_p (ipa_ref_referring_varpool_node (ref),
|
||||||
vset))
|
vset))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -614,10 +614,10 @@ lto_output_ref (struct lto_simple_output_block *ob, struct ipa_ref *ref,
|
||||||
{
|
{
|
||||||
struct bitpack_d bp;
|
struct bitpack_d bp;
|
||||||
bp = bitpack_create (ob->main_stream);
|
bp = bitpack_create (ob->main_stream);
|
||||||
bp_pack_value (&bp, ref->refered_type, 1);
|
bp_pack_value (&bp, symtab_function_p (ref->referred), 1);
|
||||||
bp_pack_value (&bp, ref->use, 2);
|
bp_pack_value (&bp, ref->use, 2);
|
||||||
streamer_write_bitpack (&bp);
|
streamer_write_bitpack (&bp);
|
||||||
if (ref->refered_type == IPA_REF_CGRAPH)
|
if (symtab_function_p (ref->referred))
|
||||||
{
|
{
|
||||||
int nref = lto_cgraph_encoder_lookup (encoder, ipa_ref_node (ref));
|
int nref = lto_cgraph_encoder_lookup (encoder, ipa_ref_node (ref));
|
||||||
gcc_assert (nref != LCC_NOT_FOUND);
|
gcc_assert (nref != LCC_NOT_FOUND);
|
||||||
|
|
@ -674,7 +674,7 @@ add_references (lto_cgraph_encoder_t encoder,
|
||||||
int i;
|
int i;
|
||||||
struct ipa_ref *ref;
|
struct ipa_ref *ref;
|
||||||
for (i = 0; ipa_ref_list_reference_iterate (list, i, ref); i++)
|
for (i = 0; ipa_ref_list_reference_iterate (list, i, ref); i++)
|
||||||
if (ref->refered_type == IPA_REF_CGRAPH)
|
if (symtab_function_p (ref->referred))
|
||||||
add_node_to (encoder, ipa_ref_node (ref), false);
|
add_node_to (encoder, ipa_ref_node (ref), false);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1108,27 +1108,26 @@ input_varpool_node (struct lto_file_decl_data *file_data,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
input_ref (struct lto_input_block *ib,
|
input_ref (struct lto_input_block *ib,
|
||||||
struct cgraph_node *refering_node,
|
symtab_node referring_node,
|
||||||
struct varpool_node *refering_varpool_node,
|
|
||||||
VEC(cgraph_node_ptr, heap) *nodes,
|
VEC(cgraph_node_ptr, heap) *nodes,
|
||||||
VEC(varpool_node_ptr, heap) *varpool_nodes_vec)
|
VEC(varpool_node_ptr, heap) *varpool_nodes_vec)
|
||||||
{
|
{
|
||||||
struct cgraph_node *node = NULL;
|
struct cgraph_node *node = NULL;
|
||||||
struct varpool_node *varpool_node = NULL;
|
struct varpool_node *varpool_node = NULL;
|
||||||
struct bitpack_d bp;
|
struct bitpack_d bp;
|
||||||
enum ipa_ref_type type;
|
int type;
|
||||||
enum ipa_ref_use use;
|
enum ipa_ref_use use;
|
||||||
|
|
||||||
bp = streamer_read_bitpack (ib);
|
bp = streamer_read_bitpack (ib);
|
||||||
type = (enum ipa_ref_type) bp_unpack_value (&bp, 1);
|
type = bp_unpack_value (&bp, 1);
|
||||||
use = (enum ipa_ref_use) bp_unpack_value (&bp, 2);
|
use = (enum ipa_ref_use) bp_unpack_value (&bp, 2);
|
||||||
if (type == IPA_REF_CGRAPH)
|
if (type)
|
||||||
node = VEC_index (cgraph_node_ptr, nodes, streamer_read_hwi (ib));
|
node = VEC_index (cgraph_node_ptr, nodes, streamer_read_hwi (ib));
|
||||||
else
|
else
|
||||||
varpool_node = VEC_index (varpool_node_ptr, varpool_nodes_vec,
|
varpool_node = VEC_index (varpool_node_ptr, varpool_nodes_vec,
|
||||||
streamer_read_hwi (ib));
|
streamer_read_hwi (ib));
|
||||||
ipa_record_reference (refering_node, refering_varpool_node,
|
ipa_record_reference (referring_node,
|
||||||
node, varpool_node, use, NULL);
|
node ? (symtab_node) node : (symtab_node) varpool_node, use, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read an edge from IB. NODES points to a vector of previously read nodes for
|
/* Read an edge from IB. NODES points to a vector of previously read nodes for
|
||||||
|
|
@ -1324,7 +1323,7 @@ input_refs (struct lto_input_block *ib,
|
||||||
node = VEC_index (cgraph_node_ptr, nodes, idx);
|
node = VEC_index (cgraph_node_ptr, nodes, idx);
|
||||||
while (count)
|
while (count)
|
||||||
{
|
{
|
||||||
input_ref (ib, node, NULL, nodes, varpool);
|
input_ref (ib, (symtab_node) node, nodes, varpool);
|
||||||
count--;
|
count--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1338,7 +1337,7 @@ input_refs (struct lto_input_block *ib,
|
||||||
streamer_read_uhwi (ib));
|
streamer_read_uhwi (ib));
|
||||||
while (count)
|
while (count)
|
||||||
{
|
{
|
||||||
input_ref (ib, NULL, node, nodes, varpool);
|
input_ref (ib, (symtab_node) node, nodes, varpool);
|
||||||
count--;
|
count--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -249,7 +249,7 @@ lto_cgraph_replace_node (struct cgraph_node *node,
|
||||||
e->call_stmt_cannot_inline_p = 1;
|
e->call_stmt_cannot_inline_p = 1;
|
||||||
}
|
}
|
||||||
/* Redirect incomming references. */
|
/* Redirect incomming references. */
|
||||||
ipa_clone_refering (prevailing_node, NULL, &node->symbol.ref_list);
|
ipa_clone_referring ((symtab_node)prevailing_node, &node->symbol.ref_list);
|
||||||
|
|
||||||
/* Finally remove the replaced node. */
|
/* Finally remove the replaced node. */
|
||||||
cgraph_remove_node (node);
|
cgraph_remove_node (node);
|
||||||
|
|
@ -271,7 +271,7 @@ lto_varpool_replace_node (struct varpool_node *vnode,
|
||||||
gcc_assert (!vnode->finalized || prevailing_node->finalized);
|
gcc_assert (!vnode->finalized || prevailing_node->finalized);
|
||||||
gcc_assert (!vnode->analyzed || prevailing_node->analyzed);
|
gcc_assert (!vnode->analyzed || prevailing_node->analyzed);
|
||||||
|
|
||||||
ipa_clone_refering (NULL, prevailing_node, &vnode->symbol.ref_list);
|
ipa_clone_referring ((symtab_node)prevailing_node, &vnode->symbol.ref_list);
|
||||||
|
|
||||||
/* Be sure we can garbage collect the initializer. */
|
/* Be sure we can garbage collect the initializer. */
|
||||||
if (DECL_INITIAL (vnode->symbol.decl))
|
if (DECL_INITIAL (vnode->symbol.decl))
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
2012-04-18 Jan Hubicka <jh@suse.cz>
|
||||||
|
|
||||||
|
* lto-partition.c (add_references_to_partition, lto_balanced_map):
|
||||||
|
Update for new ipa-ref API.
|
||||||
|
|
||||||
2012-04-16 Jan Hubicka <jh@suse.cz>
|
2012-04-16 Jan Hubicka <jh@suse.cz>
|
||||||
|
|
||||||
* lto.c (read_cgraph_and_symbols): Use FOR_EACH
|
* lto.c (read_cgraph_and_symbols): Use FOR_EACH
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ add_references_to_partition (ltrans_partition part, struct ipa_ref_list *refs)
|
||||||
struct ipa_ref *ref;
|
struct ipa_ref *ref;
|
||||||
for (i = 0; ipa_ref_list_reference_iterate (refs, i, ref); i++)
|
for (i = 0; ipa_ref_list_reference_iterate (refs, i, ref); i++)
|
||||||
{
|
{
|
||||||
if (ref->refered_type == IPA_REF_CGRAPH
|
if (symtab_function_p (ref->referred)
|
||||||
&& (DECL_COMDAT (cgraph_function_node (ipa_ref_node (ref),
|
&& (DECL_COMDAT (cgraph_function_node (ipa_ref_node (ref),
|
||||||
NULL)->symbol.decl)
|
NULL)->symbol.decl)
|
||||||
|| (ref->use == IPA_REF_ALIAS
|
|| (ref->use == IPA_REF_ALIAS
|
||||||
|
|
@ -81,7 +81,7 @@ add_references_to_partition (ltrans_partition part, struct ipa_ref_list *refs)
|
||||||
&& !cgraph_node_in_set_p (ipa_ref_node (ref), part->cgraph_set))
|
&& !cgraph_node_in_set_p (ipa_ref_node (ref), part->cgraph_set))
|
||||||
add_cgraph_node_to_partition (part, ipa_ref_node (ref));
|
add_cgraph_node_to_partition (part, ipa_ref_node (ref));
|
||||||
else
|
else
|
||||||
if (ref->refered_type == IPA_REF_VARPOOL
|
if (symtab_variable_p (ref->referred)
|
||||||
&& (DECL_COMDAT (ipa_ref_varpool_node (ref)->symbol.decl)
|
&& (DECL_COMDAT (ipa_ref_varpool_node (ref)->symbol.decl)
|
||||||
|| (ref->use == IPA_REF_ALIAS
|
|| (ref->use == IPA_REF_ALIAS
|
||||||
&& lookup_attribute
|
&& lookup_attribute
|
||||||
|
|
@ -91,26 +91,26 @@ add_references_to_partition (ltrans_partition part, struct ipa_ref_list *refs)
|
||||||
part->varpool_set))
|
part->varpool_set))
|
||||||
add_varpool_node_to_partition (part, ipa_ref_varpool_node (ref));
|
add_varpool_node_to_partition (part, ipa_ref_varpool_node (ref));
|
||||||
}
|
}
|
||||||
for (i = 0; ipa_ref_list_refering_iterate (refs, i, ref); i++)
|
for (i = 0; ipa_ref_list_referring_iterate (refs, i, ref); i++)
|
||||||
{
|
{
|
||||||
if (ref->refering_type == IPA_REF_CGRAPH
|
if (symtab_function_p (ref->referring)
|
||||||
&& ref->use == IPA_REF_ALIAS
|
&& ref->use == IPA_REF_ALIAS
|
||||||
&& !cgraph_node_in_set_p (ipa_ref_refering_node (ref),
|
&& !cgraph_node_in_set_p (ipa_ref_referring_node (ref),
|
||||||
part->cgraph_set)
|
part->cgraph_set)
|
||||||
&& !lookup_attribute ("weakref",
|
&& !lookup_attribute ("weakref",
|
||||||
DECL_ATTRIBUTES
|
DECL_ATTRIBUTES
|
||||||
(ipa_ref_refering_node (ref)->symbol.decl)))
|
(ipa_ref_referring_node (ref)->symbol.decl)))
|
||||||
add_cgraph_node_to_partition (part, ipa_ref_refering_node (ref));
|
add_cgraph_node_to_partition (part, ipa_ref_referring_node (ref));
|
||||||
else
|
else
|
||||||
if (ref->refering_type == IPA_REF_VARPOOL
|
if (symtab_variable_p (ref->referring)
|
||||||
&& ref->use == IPA_REF_ALIAS
|
&& ref->use == IPA_REF_ALIAS
|
||||||
&& !varpool_node_in_set_p (ipa_ref_refering_varpool_node (ref),
|
&& !varpool_node_in_set_p (ipa_ref_referring_varpool_node (ref),
|
||||||
part->varpool_set)
|
part->varpool_set)
|
||||||
&& !lookup_attribute ("weakref",
|
&& !lookup_attribute ("weakref",
|
||||||
DECL_ATTRIBUTES
|
DECL_ATTRIBUTES
|
||||||
(ipa_ref_refering_varpool_node (ref)->symbol.decl)))
|
(ipa_ref_referring_varpool_node (ref)->symbol.decl)))
|
||||||
add_varpool_node_to_partition (part,
|
add_varpool_node_to_partition (part,
|
||||||
ipa_ref_refering_varpool_node (ref));
|
ipa_ref_referring_varpool_node (ref));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -612,7 +612,7 @@ lto_balanced_map (void)
|
||||||
/* Compute boundary cost of IPA REF edges and at the same time look into
|
/* Compute boundary cost of IPA REF edges and at the same time look into
|
||||||
variables referenced from current partition and try to add them. */
|
variables referenced from current partition and try to add them. */
|
||||||
for (j = 0; ipa_ref_list_reference_iterate (refs, j, ref); j++)
|
for (j = 0; ipa_ref_list_reference_iterate (refs, j, ref); j++)
|
||||||
if (ref->refered_type == IPA_REF_VARPOOL)
|
if (symtab_variable_p (ref->referred))
|
||||||
{
|
{
|
||||||
varpool_node_set_iterator vsi;
|
varpool_node_set_iterator vsi;
|
||||||
|
|
||||||
|
|
@ -643,12 +643,12 @@ lto_balanced_map (void)
|
||||||
else
|
else
|
||||||
cost++;
|
cost++;
|
||||||
}
|
}
|
||||||
for (j = 0; ipa_ref_list_refering_iterate (refs, j, ref); j++)
|
for (j = 0; ipa_ref_list_referring_iterate (refs, j, ref); j++)
|
||||||
if (ref->refering_type == IPA_REF_VARPOOL)
|
if (symtab_variable_p (ref->referring))
|
||||||
{
|
{
|
||||||
varpool_node_set_iterator vsi;
|
varpool_node_set_iterator vsi;
|
||||||
|
|
||||||
vnode = ipa_ref_refering_varpool_node (ref);
|
vnode = ipa_ref_referring_varpool_node (ref);
|
||||||
gcc_assert (vnode->finalized);
|
gcc_assert (vnode->finalized);
|
||||||
if (!vnode->symbol.aux && flag_toplevel_reorder
|
if (!vnode->symbol.aux && flag_toplevel_reorder
|
||||||
&& partition_varpool_node_p (vnode))
|
&& partition_varpool_node_p (vnode))
|
||||||
|
|
@ -664,7 +664,7 @@ lto_balanced_map (void)
|
||||||
{
|
{
|
||||||
cgraph_node_set_iterator csi;
|
cgraph_node_set_iterator csi;
|
||||||
|
|
||||||
node = ipa_ref_refering_node (ref);
|
node = ipa_ref_referring_node (ref);
|
||||||
gcc_assert (node->analyzed);
|
gcc_assert (node->analyzed);
|
||||||
csi = cgraph_node_set_find (partition->cgraph_set, node);
|
csi = cgraph_node_set_find (partition->cgraph_set, node);
|
||||||
if (!csi_end_p (csi)
|
if (!csi_end_p (csi)
|
||||||
|
|
@ -876,7 +876,7 @@ lto_promote_cross_file_statics (void)
|
||||||
ipa_ref_list_reference_iterate (&vnode->symbol.ref_list, i, ref);
|
ipa_ref_list_reference_iterate (&vnode->symbol.ref_list, i, ref);
|
||||||
i++)
|
i++)
|
||||||
{
|
{
|
||||||
if (ref->refered_type == IPA_REF_CGRAPH)
|
if (symtab_function_p (ref->referred))
|
||||||
{
|
{
|
||||||
struct cgraph_node *n = ipa_ref_node (ref);
|
struct cgraph_node *n = ipa_ref_node (ref);
|
||||||
gcc_assert (!n->global.inlined_to);
|
gcc_assert (!n->global.inlined_to);
|
||||||
|
|
|
||||||
|
|
@ -2258,7 +2258,7 @@ operands_match_p (rtx x, rtx y)
|
||||||
if (GET_MODE (x) != GET_MODE (y))
|
if (GET_MODE (x) != GET_MODE (y))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* MEMs refering to different address space are not equivalent. */
|
/* MEMs referring to different address space are not equivalent. */
|
||||||
if (code == MEM && MEM_ADDR_SPACE (x) != MEM_ADDR_SPACE (y))
|
if (code == MEM && MEM_ADDR_SPACE (x) != MEM_ADDR_SPACE (y))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -381,7 +381,7 @@ rtx_equal_p_cb (const_rtx x, const_rtx y, rtx_equal_p_callback_function cb)
|
||||||
if (GET_MODE (x) != GET_MODE (y))
|
if (GET_MODE (x) != GET_MODE (y))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* MEMs refering to different address space are not equivalent. */
|
/* MEMs referring to different address space are not equivalent. */
|
||||||
if (code == MEM && MEM_ADDR_SPACE (x) != MEM_ADDR_SPACE (y))
|
if (code == MEM && MEM_ADDR_SPACE (x) != MEM_ADDR_SPACE (y))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
@ -520,7 +520,7 @@ rtx_equal_p (const_rtx x, const_rtx y)
|
||||||
if (GET_MODE (x) != GET_MODE (y))
|
if (GET_MODE (x) != GET_MODE (y))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* MEMs refering to different address space are not equivalent. */
|
/* MEMs referring to different address space are not equivalent. */
|
||||||
if (code == MEM && MEM_ADDR_SPACE (x) != MEM_ADDR_SPACE (y))
|
if (code == MEM && MEM_ADDR_SPACE (x) != MEM_ADDR_SPACE (y))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3981,7 +3981,7 @@ nonzero_bits1 (const_rtx x, enum machine_mode mode, const_rtx known_x,
|
||||||
#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
|
#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
|
||||||
/* If pointers extend unsigned and this is a pointer in Pmode, say that
|
/* If pointers extend unsigned and this is a pointer in Pmode, say that
|
||||||
all the bits above ptr_mode are known to be zero. */
|
all the bits above ptr_mode are known to be zero. */
|
||||||
/* As we do not know which address space the pointer is refering to,
|
/* As we do not know which address space the pointer is referring to,
|
||||||
we can do this only if the target does not support different pointer
|
we can do this only if the target does not support different pointer
|
||||||
or address modes depending on the address space. */
|
or address modes depending on the address space. */
|
||||||
if (target_default_pointer_address_modes_p ()
|
if (target_default_pointer_address_modes_p ()
|
||||||
|
|
@ -4491,7 +4491,7 @@ num_sign_bit_copies1 (const_rtx x, enum machine_mode mode, const_rtx known_x,
|
||||||
#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
|
#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
|
||||||
/* If pointers extend signed and this is a pointer in Pmode, say that
|
/* If pointers extend signed and this is a pointer in Pmode, say that
|
||||||
all the bits above ptr_mode are known to be sign bit copies. */
|
all the bits above ptr_mode are known to be sign bit copies. */
|
||||||
/* As we do not know which address space the pointer is refering to,
|
/* As we do not know which address space the pointer is referring to,
|
||||||
we can do this only if the target does not support different pointer
|
we can do this only if the target does not support different pointer
|
||||||
or address modes depending on the address space. */
|
or address modes depending on the address space. */
|
||||||
if (target_default_pointer_address_modes_p ()
|
if (target_default_pointer_address_modes_p ()
|
||||||
|
|
|
||||||
|
|
@ -1140,7 +1140,7 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
|
#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
|
||||||
/* As we do not know which address space the pointer is refering to,
|
/* As we do not know which address space the pointer is referring to,
|
||||||
we can do this only if the target does not support different pointer
|
we can do this only if the target does not support different pointer
|
||||||
or address modes depending on the address space. */
|
or address modes depending on the address space. */
|
||||||
if (target_default_pointer_address_modes_p ()
|
if (target_default_pointer_address_modes_p ()
|
||||||
|
|
@ -1233,7 +1233,7 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
|
#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
|
||||||
/* As we do not know which address space the pointer is refering to,
|
/* As we do not know which address space the pointer is referring to,
|
||||||
we can do this only if the target does not support different pointer
|
we can do this only if the target does not support different pointer
|
||||||
or address modes depending on the address space. */
|
or address modes depending on the address space. */
|
||||||
if (target_default_pointer_address_modes_p ()
|
if (target_default_pointer_address_modes_p ()
|
||||||
|
|
|
||||||
|
|
@ -191,7 +191,7 @@ symtab_unregister_node (symtab_node node)
|
||||||
{
|
{
|
||||||
void **slot;
|
void **slot;
|
||||||
ipa_remove_all_references (&node->symbol.ref_list);
|
ipa_remove_all_references (&node->symbol.ref_list);
|
||||||
ipa_remove_all_refering (&node->symbol.ref_list);
|
ipa_remove_all_referring (&node->symbol.ref_list);
|
||||||
|
|
||||||
if (node->symbol.same_comdat_group)
|
if (node->symbol.same_comdat_group)
|
||||||
{
|
{
|
||||||
|
|
@ -429,8 +429,8 @@ dump_symtab_base (FILE *f, symtab_node node)
|
||||||
|
|
||||||
fprintf (f, " References: ");
|
fprintf (f, " References: ");
|
||||||
ipa_dump_references (f, &node->symbol.ref_list);
|
ipa_dump_references (f, &node->symbol.ref_list);
|
||||||
fprintf (f, " Refering: ");
|
fprintf (f, " Referring: ");
|
||||||
ipa_dump_refering (f, &node->symbol.ref_list);
|
ipa_dump_referring (f, &node->symbol.ref_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Dump symtab node. */
|
/* Dump symtab node. */
|
||||||
|
|
|
||||||
|
|
@ -4931,9 +4931,9 @@ ipa_tm_execute (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Propagate back to referring aliases as well. */
|
/* Propagate back to referring aliases as well. */
|
||||||
for (j = 0; ipa_ref_list_refering_iterate (&node->symbol.ref_list, j, ref); j++)
|
for (j = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list, j, ref); j++)
|
||||||
{
|
{
|
||||||
caller = ref->refering.cgraph_node;
|
caller = cgraph (ref->referring);
|
||||||
if (ref->use == IPA_REF_ALIAS
|
if (ref->use == IPA_REF_ALIAS
|
||||||
&& !caller->local.tm_may_enter_irr)
|
&& !caller->local.tm_may_enter_irr)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -446,7 +446,7 @@ gen_emutls_addr (tree decl, struct lower_emutls_data *d)
|
||||||
|
|
||||||
/* We may be adding a new reference to a new variable to the function.
|
/* We may be adding a new reference to a new variable to the function.
|
||||||
This means we have to play with the ipa-reference web. */
|
This means we have to play with the ipa-reference web. */
|
||||||
ipa_record_reference (d->cfun_node, NULL, NULL, cvar, IPA_REF_ADDR, x);
|
ipa_record_reference ((symtab_node)d->cfun_node, (symtab_node)cvar, IPA_REF_ADDR, x);
|
||||||
|
|
||||||
/* Record this ssa_name for possible use later in the basic block. */
|
/* Record this ssa_name for possible use later in the basic block. */
|
||||||
VEC_replace (tree, access_vars, index, addr);
|
VEC_replace (tree, access_vars, index, addr);
|
||||||
|
|
|
||||||
|
|
@ -1010,7 +1010,7 @@ refs_may_alias_p_1 (ao_ref *ref1, ao_ref *ref2, bool tbaa_p)
|
||||||
|| CONSTANT_CLASS_P (base2))
|
|| CONSTANT_CLASS_P (base2))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* We can end up refering to code via function and label decls.
|
/* We can end up referring to code via function and label decls.
|
||||||
As we likely do not properly track code aliases conservatively
|
As we likely do not properly track code aliases conservatively
|
||||||
bail out. */
|
bail out. */
|
||||||
if (TREE_CODE (base1) == FUNCTION_DECL
|
if (TREE_CODE (base1) == FUNCTION_DECL
|
||||||
|
|
|
||||||
|
|
@ -380,7 +380,7 @@ varpool_analyze_pending_decls (void)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!VEC_length (ipa_ref_t, node->symbol.ref_list.references))
|
if (!VEC_length (ipa_ref_t, node->symbol.ref_list.references))
|
||||||
ipa_record_reference (NULL, node, NULL, tgt, IPA_REF_ALIAS, NULL);
|
ipa_record_reference ((symtab_node)node, (symtab_node)tgt, IPA_REF_ALIAS, NULL);
|
||||||
/* C++ FE sometimes change linkage flags after producing same body aliases. */
|
/* C++ FE sometimes change linkage flags after producing same body aliases. */
|
||||||
if (node->extra_name_alias)
|
if (node->extra_name_alias)
|
||||||
{
|
{
|
||||||
|
|
@ -433,10 +433,10 @@ assemble_aliases (struct varpool_node *node)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct ipa_ref *ref;
|
struct ipa_ref *ref;
|
||||||
for (i = 0; ipa_ref_list_refering_iterate (&node->symbol.ref_list, i, ref); i++)
|
for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list, i, ref); i++)
|
||||||
if (ref->use == IPA_REF_ALIAS)
|
if (ref->use == IPA_REF_ALIAS)
|
||||||
{
|
{
|
||||||
struct varpool_node *alias = ipa_ref_refering_varpool_node (ref);
|
struct varpool_node *alias = ipa_ref_referring_varpool_node (ref);
|
||||||
assemble_alias (alias->symbol.decl,
|
assemble_alias (alias->symbol.decl,
|
||||||
DECL_ASSEMBLER_NAME (alias->alias_of));
|
DECL_ASSEMBLER_NAME (alias->alias_of));
|
||||||
assemble_aliases (alias);
|
assemble_aliases (alias);
|
||||||
|
|
@ -676,10 +676,10 @@ varpool_for_node_and_aliases (struct varpool_node *node,
|
||||||
|
|
||||||
if (callback (node, data))
|
if (callback (node, data))
|
||||||
return true;
|
return true;
|
||||||
for (i = 0; ipa_ref_list_refering_iterate (&node->symbol.ref_list, i, ref); i++)
|
for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list, i, ref); i++)
|
||||||
if (ref->use == IPA_REF_ALIAS)
|
if (ref->use == IPA_REF_ALIAS)
|
||||||
{
|
{
|
||||||
struct varpool_node *alias = ipa_ref_refering_varpool_node (ref);
|
struct varpool_node *alias = ipa_ref_referring_varpool_node (ref);
|
||||||
if (include_overwritable
|
if (include_overwritable
|
||||||
|| cgraph_variable_initializer_availability (alias) > AVAIL_OVERWRITABLE)
|
|| cgraph_variable_initializer_availability (alias) > AVAIL_OVERWRITABLE)
|
||||||
if (varpool_for_node_and_aliases (alias, callback, data,
|
if (varpool_for_node_and_aliases (alias, callback, data,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue