summaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-23 20:28:07 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-23 20:28:07 +0000
commitb9c94ed7ac6512c7551a007128fed6f3caf21ed1 (patch)
treeb2d83395a226ce339483346c7db1d16095008402 /gcc/tree.c
parentc540c53f3450941cd6da7a219d7a4794e2920e8b (diff)
downloadgcc-b9c94ed7ac6512c7551a007128fed6f3caf21ed1.tar.gz
* tree.c (decl_address_ip_invariant_p): New function.
* tree.h (decl_address_ip_invariant_p): Declare. * gimple.c (strip_invariant_refs): Break out from ... (is_gimple_invariant_address): ... here (is_gimple_ip_invariant_address): New function. (is_gimple_ip_invariant): New function. * gimple.h (is_gimple_ip_invariant_address, is_gimple_ip_invariant): Declare. * ipa-cp.c (ipcp_lat_is_const): Remove handling of IPA_CONST_VALUE_REF. (ipcp_lat_is_insertable): All constants are insertable. (ipcp_lattice_from_jfunc, ipcp_print_all_lattices): Remove handling of IPA_CONST_VALUE_REF. (ipcp_initialize_node_lattices): Propagate all types of operands. (build_const_val): Do not handle IPA_CONST_VALUE_REF. (ipcp_create_replace_map): Reformat. (ipcp_need_redirect_p): Simplify. (ipcp_insert_stage): Check that argument is used before clonning. * ipa-prop.c (ipa_print_node_jump_functions): Do not handle IPA_CONST_REF. (compute_scalar_jump_functions): Simplify using is_gimple_ip_invariat. (determine_cst_member_ptr): Keep wrapping ADDR_EXPR of members. (update_call_notes_after_inlining): Expect ADDR_EXPR in operand. * ipa-prop.h (jump_func_type): Remove IPA_CONST_REF. (jump_func_type): Remove IPA_CONST_VALUE_REF. * tree-inline.c (tree_function_versioning): Add variables referenced by replacing trees. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139523 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 95d4d5ea61e..912d77fd410 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -2172,6 +2172,40 @@ decl_address_invariant_p (const_tree op)
return false;
}
+/* Return whether OP is a DECL whose address is interprocedural-invariant. */
+
+bool
+decl_address_ip_invariant_p (const_tree op)
+{
+ /* The conditions below are slightly less strict than the one in
+ staticp. */
+
+ switch (TREE_CODE (op))
+ {
+ case LABEL_DECL:
+ case FUNCTION_DECL:
+ case STRING_CST:
+ return true;
+
+ case VAR_DECL:
+ if (((TREE_STATIC (op) || DECL_EXTERNAL (op))
+ && !DECL_DLLIMPORT_P (op))
+ || DECL_THREAD_LOCAL_P (op))
+ return true;
+ break;
+
+ case CONST_DECL:
+ if ((TREE_STATIC (op) || DECL_EXTERNAL (op)))
+ return true;
+ break;
+
+ default:
+ break;
+ }
+
+ return false;
+}
+
/* Return true if T is function-invariant (internal function, does
not handle arithmetic; that's handled in skip_simple_arithmetic and