diff options
author | aldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-08 11:13:41 +0000 |
---|---|---|
committer | aldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-08 11:13:41 +0000 |
commit | 4c0315d05fa0f707875686abc4f91f7a979a7c7b (patch) | |
tree | e07de8d0b6265f8d72388d335bd471022e753d57 /gcc/tree.c | |
parent | bf09288ee7b5f264f28081a84fde4c6aa1ac5c82 (diff) | |
download | gcc-4c0315d05fa0f707875686abc4f91f7a979a7c7b.tar.gz |
Merge from transactional-memory branch.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181154 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/gcc/tree.c b/gcc/tree.c index 2cbd68b5fd9..ba6c2e1ef8a 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -9428,6 +9428,8 @@ local_define_builtin (const char *name, tree type, enum built_in_function code, if (ecf_flags & ECF_LEAF) DECL_ATTRIBUTES (decl) = tree_cons (get_identifier ("leaf"), NULL, DECL_ATTRIBUTES (decl)); + if ((ecf_flags & ECF_TM_PURE) && flag_tm) + apply_tm_attr (decl, get_identifier ("transaction_pure")); set_builtin_decl (code, decl, true); } @@ -9593,7 +9595,8 @@ build_common_builtin_nodes (void) ftype = build_function_type_list (ptr_type_node, integer_type_node, NULL_TREE); local_define_builtin ("__builtin_eh_pointer", ftype, BUILT_IN_EH_POINTER, - "__builtin_eh_pointer", ECF_PURE | ECF_NOTHROW | ECF_LEAF); + "__builtin_eh_pointer", + ECF_PURE | ECF_NOTHROW | ECF_LEAF | ECF_TM_PURE); tmp = lang_hooks.types.type_for_mode (targetm.eh_return_filter_mode (), 0); ftype = build_function_type_list (tmp, integer_type_node, NULL_TREE); @@ -11142,6 +11145,37 @@ tree_strip_sign_nop_conversions (tree exp) return exp; } +/* Strip out all handled components that produce invariant + offsets. */ + +const_tree +strip_invariant_refs (const_tree op) +{ + while (handled_component_p (op)) + { + switch (TREE_CODE (op)) + { + case ARRAY_REF: + case ARRAY_RANGE_REF: + if (!is_gimple_constant (TREE_OPERAND (op, 1)) + || TREE_OPERAND (op, 2) != NULL_TREE + || TREE_OPERAND (op, 3) != NULL_TREE) + return NULL; + break; + + case COMPONENT_REF: + if (TREE_OPERAND (op, 2) != NULL_TREE) + return NULL; + break; + + default:; + } + op = TREE_OPERAND (op, 0); + } + + return op; +} + static GTY(()) tree gcc_eh_personality_decl; /* Return the GCC personality function decl. */ |