/* Passes for transactional memory support.
- Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
This file is part of GCC.
during lower_sequence_tm/gimplification, leave the call
to needs_to_live_in_memory until we eliminate
lower_sequence_tm altogether. */
- needs_to_live_in_memory (x)
- /* X escapes. */
- || is_global_var (x))
+ needs_to_live_in_memory (x))
return true;
else
{
}
node = cgraph_get_node (fn_decl);
+ /* All calls should have cgraph here. */
+ gcc_assert (node);
if (node->local.tm_may_enter_irr)
transaction_subcode_ior (region, GTMA_MAY_ENTER_IRREVOCABLE);
assembly statement is not relevant to the transaction
is to wrap it in a __tm_waiver block. This is not
yet implemented, so we can't check for it. */
+ if (is_tm_safe (current_function_decl))
+ {
+ tree t = build1 (NOP_EXPR, void_type_node, size_zero_node);
+ SET_EXPR_LOCATION (t, gimple_location (stmt));
+ TREE_BLOCK (t) = gimple_block (stmt);
+ error ("%Kasm not allowed in %<transaction_safe%> function", t);
+ }
return true;
default:
tree new_decl;
};
-/* A subrontine of ipa_tm_create_version, called via
+/* A subroutine of ipa_tm_create_version, called via
cgraph_for_node_and_aliases. Create new tm clones for each of
the existing aliases. */
static bool
new_node = cgraph_same_body_alias (NULL, new_decl, info->new_decl);
new_node->tm_clone = true;
+ new_node->local.externally_visible = info->old_node->local.externally_visible;
/* ?? Do not traverse aliases here. */
get_cg_data (&node, false)->clone = new_node;
DECL_COMDAT_GROUP (new_decl) = tm_mangle (DECL_COMDAT_GROUP (old_decl));
new_node = cgraph_copy_node_for_versioning (old_node, new_decl, NULL, NULL);
+ new_node->local.externally_visible = old_node->local.externally_visible;
new_node->lowered = true;
new_node->tm_clone = 1;
get_cg_data (&old_node, true)->clone = new_node;