+2019-02-13 Martin Liska <mliska@suse.cz>
+
+ * builtins.h (expand_builtin_with_bounds): Remove declaration.
+ * calls.c (struct arg_data): Remove special_slot, pointer_arg
+ and pointer_offset fields.
+ (initialize_argument_information): Remove usage of dead
+ fields.
+ * cgraph.h (struct cgraph_thunk_info): Remove
+ add_pointer_bounds_args.
+ * cgraphunit.c (cgraph_node::expand_thunk): Remove usage of dead
+ fields.
+ (cgraph_node::assemble_thunks_and_aliases): Remove usage of dead
+ fields.
+ * config/i386/i386.c (ix86_function_arg_advance): Remove
+ unrelated comment.
+ (struct builtin_isa): Remove leaf_p and nothrow_p fields.
+ (def_builtin): Remove usage of dead
+ fields.
+ (ix86_add_new_builtins): Likewise.
+ * ipa-fnsummary.c (compute_fn_summary): Likewise.
+ * ipa-icf.c (sem_function::equals_wpa): Likewise.
+ (sem_function::init): Likewise.
+ (sem_variable::merge): Likewise.
+ * ipa-visibility.c (function_and_variable_visibility): Likewise.
+ * ipa.c (symbol_table::remove_unreachable_nodes): Likewise.
+ * lto-cgraph.c (lto_output_node): Likewise.
+ (lto_output_varpool_node): Likewise.
+ (input_node): Likewise.
+ (input_varpool_node): Likewise.
+ * lto-streamer-out.c (lto_output): Likewise.
+ * tree-inline.c (expand_call_inline): Remove usage of
+ assign_stmts.
+ * tree-inline.h (struct copy_body_data): Likewise.
+ * varpool.c (varpool_node::dump): Likewise.
+
2019-02-13 Jakub Jelinek <jakub@redhat.com>
PR middle-end/89303
extern void expand_ifn_atomic_bit_test_and (gcall *);
extern void expand_ifn_atomic_compare_exchange (gcall *);
extern rtx expand_builtin (tree, rtx, rtx, machine_mode, int);
-extern rtx expand_builtin_with_bounds (tree, rtx, rtx, machine_mode, int);
extern enum built_in_function builtin_mathfn_code (const_tree);
extern tree fold_builtin_expect (location_t, tree, tree, tree, tree);
extern bool avoid_folding_inline_builtin (tree);
/* If REG is a PARALLEL, this is a copy of VALUE pulled into the correct
form for emit_group_move. */
rtx parallel_value;
- /* If value is passed in neither reg nor stack, this field holds a number
- of a special slot to be used. */
- rtx special_slot;
- /* For pointer bounds hold an index of parm bounds are bound to. -1 if
- there is no such pointer. */
- int pointer_arg;
- /* If pointer_arg refers a structure, then pointer_offset holds an offset
- of a pointer in this structure. */
- int pointer_offset;
/* If REG was promoted from the actual mode of the argument expression,
indicates whether the promotion is sign- or zero-extended. */
int unsignedp;
argpos < n_named_args);
if (args[i].reg && CONST_INT_P (args[i].reg))
- {
- args[i].special_slot = args[i].reg;
- args[i].reg = NULL;
- }
+ args[i].reg = NULL;
/* If this is a sibling call and the machine has register windows, the
register window has to be unwinded before calling the routine, so
the virtual one. */
bool virtual_offset_p;
- /* ??? True for special kind of thunks, seems related to instrumentation. */
- bool add_pointer_bounds_args;
-
/* Set to true when alias node (the cgraph_node to which this struct belong)
is a thunk. Access to any other fields is invalid if this is false. */
bool thunk_p;
/* Set when variable is scheduled to be assembled. */
unsigned output : 1;
- /* Set when variable has statically initialized pointer
- or is a static bounds variable and needs initalization. */
- unsigned need_bounds_init : 1;
-
/* Set if the variable is dynamically initialized, except for
function local statics. */
unsigned dynamically_initialized : 1;
tree thunk_fndecl = decl;
tree a;
- /* Instrumentation thunk is the same function with
- a different signature. Never need to expand it. */
- if (thunk.add_pointer_bounds_args)
- return false;
-
if (!force_gimple_thunk
&& this_adjusting
&& indirect_offset == 0
for (e = callers; e;)
if (e->caller->thunk.thunk_p
- && !e->caller->global.inlined_to
- && !e->caller->thunk.add_pointer_bounds_args)
+ && !e->caller->global.inlined_to)
{
cgraph_node *thunk = e->caller;
else
nregs = function_arg_advance_32 (cum, mode, type, bytes, words);
- /* For pointers passed in memory we expect bounds passed in Bounds
- Table. */
if (!nregs)
{
/* Track if there are outgoing arguments on stack. */
enum ix86_builtin_func_type tcode; /* type to use in the declaration */
unsigned char const_p:1; /* true if the declaration is constant */
unsigned char pure_p:1; /* true if the declaration has pure attribute */
- bool leaf_p; /* true if the declaration has leaf attribute */
- bool nothrow_p; /* true if the declaration has nothrow attribute */
bool set_and_not_built_p;
};
ix86_builtins[(int) code] = NULL_TREE;
ix86_builtins_isa[(int) code].tcode = tcode;
ix86_builtins_isa[(int) code].name = name;
- ix86_builtins_isa[(int) code].leaf_p = false;
- ix86_builtins_isa[(int) code].nothrow_p = false;
ix86_builtins_isa[(int) code].const_p = false;
ix86_builtins_isa[(int) code].pure_p = false;
ix86_builtins_isa[(int) code].set_and_not_built_p = true;
ix86_builtins[i] = decl;
if (ix86_builtins_isa[i].const_p)
TREE_READONLY (decl) = 1;
- if (ix86_builtins_isa[i].pure_p)
- DECL_PURE_P (decl) = 1;
- if (ix86_builtins_isa[i].leaf_p)
- DECL_ATTRIBUTES (decl) = build_tree_list (get_identifier ("leaf"),
- NULL_TREE);
- if (ix86_builtins_isa[i].nothrow_p)
- TREE_NOTHROW (decl) = 1;
}
}
info->account_size_time (2 * ipa_fn_summary::size_scale, 0, t, t);
ipa_update_overall_fn_summary (node);
info->self_size = info->size;
- /* We cannot inline instrumentation clones. */
- if (node->thunk.add_pointer_bounds_args)
- {
- info->inlinable = false;
- node->callees->inline_failed = CIF_CHKP;
- }
- else if (stdarg_p (TREE_TYPE (node->decl)))
+ if (stdarg_p (TREE_TYPE (node->decl)))
{
info->inlinable = false;
node->callees->inline_failed = CIF_VARIADIC_THUNK;
node->local.can_change_signature = !e;
}
}
- /* Functions called by instrumentation thunk can't change signature
- because instrumentation thunk modification is not supported. */
- if (node->local.can_change_signature)
- for (e = node->callers; e; e = e->next_caller)
- if (e->caller->thunk.thunk_p
- && e->caller->thunk.add_pointer_bounds_args)
- {
- node->local.can_change_signature = false;
- break;
- }
analyze_function_body (node, early);
pop_cfun ();
}
return return_false_with_msg ("thunk this_adjusting mismatch");
if (cnode->thunk.virtual_offset_p != cnode2->thunk.virtual_offset_p)
return return_false_with_msg ("thunk virtual_offset_p mismatch");
- if (cnode->thunk.add_pointer_bounds_args
- != cnode2->thunk.add_pointer_bounds_args)
- return return_false_with_msg ("thunk add_pointer_bounds_args mismatch");
}
/* Compare special function DECL attributes. */
hstate.add_hwi (cnode->thunk.virtual_value);
hstate.add_flag (cnode->thunk.this_adjusting);
hstate.add_flag (cnode->thunk.virtual_offset_p);
- hstate.add_flag (cnode->thunk.add_pointer_bounds_args);
gcode_hash = hstate.end ();
}
}
DECL_INITIAL (alias->decl) = NULL;
((symtab_node *)alias)->call_for_symbol_and_aliases (clear_decl_rtl,
NULL, true);
- alias->need_bounds_init = false;
alias->remove_all_references ();
if (TREE_ADDRESSABLE (alias->decl))
original->call_for_symbol_and_aliases (set_addressable, NULL, true);
localize_node (whole_program, node);
if (node->thunk.thunk_p
- && !node->thunk.add_pointer_bounds_args
&& TREE_PUBLIC (node->decl))
{
struct cgraph_node *decl_node = node;
node->remove_callees ();
node->remove_all_references ();
changed = true;
- if (node->thunk.thunk_p
- && node->thunk.add_pointer_bounds_args)
- {
- node->thunk.thunk_p = false;
- node->thunk.add_pointer_bounds_args = false;
- }
}
}
else
streamer_write_uhwi_stream
(ob->main_stream,
1 + (node->thunk.this_adjusting != 0) * 2
- + (node->thunk.virtual_offset_p != 0) * 4
- + (node->thunk.add_pointer_bounds_args != 0) * 8);
+ + (node->thunk.virtual_offset_p != 0) * 4);
streamer_write_uhwi_stream (ob->main_stream, node->thunk.fixed_offset);
streamer_write_uhwi_stream (ob->main_stream, node->thunk.virtual_value);
streamer_write_uhwi_stream (ob->main_stream, node->thunk.indirect_offset);
bp_pack_value (&bp, node->tls_model, 3);
bp_pack_value (&bp, node->used_by_single_function, 1);
bp_pack_value (&bp, node->dynamically_initialized, 1);
- bp_pack_value (&bp, node->need_bounds_init, 1);
streamer_write_bitpack (&bp);
group = node->get_comdat_group ();
node->thunk.indirect_offset = indirect_offset;
node->thunk.this_adjusting = (type & 2);
node->thunk.virtual_offset_p = (type & 4);
- node->thunk.add_pointer_bounds_args = (type & 8);
}
if (node->alias && !node->analyzed && node->weakref)
node->alias_target = get_alias_symbol (node->decl);
node->tls_model = (enum tls_model)bp_unpack_value (&bp, 3);
node->used_by_single_function = (enum tls_model)bp_unpack_value (&bp, 1);
node->dynamically_initialized = bp_unpack_value (&bp, 1);
- node->need_bounds_init = bp_unpack_value (&bp, 1);
group = read_identifier (ib);
if (group)
{
if (cgraph_node *node = dyn_cast <cgraph_node *> (snode))
{
if (lto_symtab_encoder_encode_body_p (encoder, node)
- && !node->alias
- && (!node->thunk.thunk_p || !node->thunk.add_pointer_bounds_args))
+ && !node->alias)
{
if (flag_checking)
{
/* We will be inlining this callee. */
id->eh_lp_nr = lookup_stmt_eh_lp (stmt);
- id->assign_stmts.create (0);
/* Update the callers EH personality. */
if (DECL_FUNCTION_PERSONALITY (fn))
TREE_USED (gimple_assign_rhs1 (stmt)) = 1;
}
- id->assign_stmts.release ();
id->add_clobbers_to_eh_landing_pads = 0;
/* Output the inlining info for this abstract function, since it has been
/* The VAR_DECL for the return value. */
tree retvar;
- /* Assign statements that need bounds copy. */
- vec<gimple *> assign_stmts;
-
/* The map from local declarations in the inlined function to
equivalents in the function into which it is being inlined. */
hash_map<tree, tree> *decl_map;
fprintf (f, " output");
if (used_by_single_function)
fprintf (f, " used-by-single-function");
- if (need_bounds_init)
- fprintf (f, " need-bounds-init");
if (TREE_READONLY (decl))
fprintf (f, " read-only");
if (ctor_useable_for_folding_p ())