/* Passes for transactional memory support.
- Copyright (C) 2008-2020 Free Software Foundation, Inc.
+ Copyright (C) 2008-2021 Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@redhat.com>
and Aldy Hernandez <aldyh@redhat.com>.
#include "tree-ssa-address.h"
#include "stringpool.h"
#include "attribs.h"
+#include "alloc-pool.h"
+#include "symbol-summary.h"
+#include "symtab-thunks.h"
#define A_RUNINSTRUMENTEDCODE 0x0001
#define A_RUNUNINSTRUMENTEDCODE 0x0002
/* We could store this information in bb->aux, but we may get called
through get_all_tm_blocks() from another pass that may be already
using bb->aux. */
- bb_regions.safe_grow_cleared (last_basic_block_for_fn (cfun));
+ bb_regions.safe_grow_cleared (last_basic_block_for_fn (cfun), true);
all_tm_regions = region;
bb = single_succ (ENTRY_BLOCK_PTR_FOR_FN (cfun));
if (is_gimple_reg (rhs))
{
tree rtmp = create_tmp_var (TREE_TYPE (rhs));
+ TREE_ADDRESSABLE (rtmp) = 1;
rhs_addr = build_fold_addr_expr (rtmp);
gcall = gimple_build_assign (rtmp, rhs);
gsi_insert_before (gsi, gcall, GSI_SAME_STMT);
vec<tm_region *> ret;
ret.create (n);
- ret.safe_grow_cleared (n);
+ ret.safe_grow_cleared (n, true);
stuff.bb2reg = &ret;
stuff.include_uninstrumented_p = include_uninstrumented_p;
expand_regions (all_tm_regions, collect_bb2reg, &stuff, traverse_clones);
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));
- error ("%K%<asm%> not allowed in %<transaction_safe%> function",
- t);
- }
+ error_at (gimple_location (stmt),
+ "%<asm%> not allowed in %<transaction_safe%> function");
return true;
default:
result in one of the bits above being set so that we will not
have to recurse next time. */
if (node->alias)
- return ipa_tm_mayenterirr_function (cgraph_node::get (node->thunk.alias));
+ return ipa_tm_mayenterirr_function
+ (cgraph_node::get (thunk_info::get (node)->alias));
/* What remains is unmarked local functions without items that force
the function to go irrevocable. */
new_node->lowered = true;
new_node->tm_clone = 1;
if (!old_node->implicit_section)
- new_node->set_section (old_node->get_section ());
+ new_node->set_section (*old_node);
get_cg_data (&old_node, true)->clone = new_node;
if (old_node->get_availability () >= AVAIL_INTERPOSABLE)
we need not scan the callees now, as the base will do. */
if (node->alias)
{
- node = cgraph_node::get (node->thunk.alias);
+ node = cgraph_node::get (thunk_info::get (node)->alias);
d = get_cg_data (&node, true);
maybe_push_queue (node, &tm_callees, &d->in_callee_queue);
continue;