tree-core.h (tree_block::abstract_flag): Remove.

2018-10-05  Richard Biener  <rguenther@suse.de>

	* tree-core.h (tree_block::abstract_flag): Remove.
	(tree_block::block_num): Make full 32bits.
	* tree.def (BLOCK): Remove docs about BLOCK_ABSTRACT.
	* tree.h (BLOCK_ABSTRACT): Remove.
	* dwarf2out.c (gen_lexical_block_die): Remove dead code
	resulting from BLOCK_ABSTRACT being always false.
	(gen_inlined_subroutine_die): Likewise.
	(gen_block_die): Likewise.
	* tree.c (block_ultimate_origin): Likewise.
	* tree-pretty-print.c (dump_block_node): Remove code dealing
	with BLOCK_ABSTRACT.
	* tree-ssa-live.c (dump_scope_block): Likewise.
	* tree-streamer-in.c (unpack_ts_block_value_fields): Likewise.
	* tree-streamer-out.c (pack_ts_block_value_fields): Likewise.

From-SVN: r264868
This commit is contained in:
Richard Biener 2018-10-05 11:46:12 +00:00 committed by Richard Biener
parent 3f41c986d2
commit 700adeb6fd
10 changed files with 51 additions and 95 deletions

View File

@ -1,3 +1,20 @@
2018-10-05 Richard Biener <rguenther@suse.de>
* tree-core.h (tree_block::abstract_flag): Remove.
(tree_block::block_num): Make full 32bits.
* tree.def (BLOCK): Remove docs about BLOCK_ABSTRACT.
* tree.h (BLOCK_ABSTRACT): Remove.
* dwarf2out.c (gen_lexical_block_die): Remove dead code
resulting from BLOCK_ABSTRACT being always false.
(gen_inlined_subroutine_die): Likewise.
(gen_block_die): Likewise.
* tree.c (block_ultimate_origin): Likewise.
* tree-pretty-print.c (dump_block_node): Remove code dealing
with BLOCK_ABSTRACT.
* tree-ssa-live.c (dump_scope_block): Likewise.
* tree-streamer-in.c (unpack_ts_block_value_fields): Likewise.
* tree-streamer-out.c (pack_ts_block_value_fields): Likewise.
2018-10-05 Richard Biener <rguenther@suse.de> 2018-10-05 Richard Biener <rguenther@suse.de>
* config/i386/i386.c (ix86_add_stmt_cost): When scalar cost * config/i386/i386.c (ix86_add_stmt_cost): When scalar cost

View File

@ -24009,7 +24009,7 @@ add_high_low_attributes (tree stmt, dw_die_ref die)
} }
if (attr != NULL if (attr != NULL
&& ((*ranges_table)[attr->dw_attr_val.v.val_offset].num && ((*ranges_table)[attr->dw_attr_val.v.val_offset].num
== BLOCK_NUMBER (superblock)) == (int)BLOCK_NUMBER (superblock))
&& BLOCK_FRAGMENT_CHAIN (superblock)) && BLOCK_FRAGMENT_CHAIN (superblock))
{ {
unsigned long off = attr->dw_attr_val.v.val_offset; unsigned long off = attr->dw_attr_val.v.val_offset;
@ -24019,7 +24019,7 @@ add_high_low_attributes (tree stmt, dw_die_ref die)
{ {
++supercnt; ++supercnt;
gcc_checking_assert ((*ranges_table)[off + supercnt].num gcc_checking_assert ((*ranges_table)[off + supercnt].num
== BLOCK_NUMBER (chain)); == (int)BLOCK_NUMBER (chain));
} }
gcc_checking_assert ((*ranges_table)[off + supercnt + 1].num == 0); gcc_checking_assert ((*ranges_table)[off + supercnt + 1].num == 0);
for (chain = BLOCK_FRAGMENT_CHAIN (stmt); for (chain = BLOCK_FRAGMENT_CHAIN (stmt);
@ -24071,25 +24071,7 @@ gen_lexical_block_die (tree stmt, dw_die_ref context_die)
equate_block_to_die (stmt, stmt_die); equate_block_to_die (stmt, stmt_die);
} }
if (BLOCK_ABSTRACT (stmt)) if (BLOCK_ABSTRACT_ORIGIN (stmt))
{
if (old_die)
{
/* This must have been generated early and it won't even
need location information since it's a DW_AT_inline
function. */
if (flag_checking)
for (dw_die_ref c = context_die; c; c = c->die_parent)
if (c->die_tag == DW_TAG_inlined_subroutine
|| c->die_tag == DW_TAG_subprogram)
{
gcc_assert (get_AT (c, DW_AT_inline));
break;
}
return;
}
}
else if (BLOCK_ABSTRACT_ORIGIN (stmt))
{ {
/* If this is an inlined or conrecte instance, create a new lexical /* If this is an inlined or conrecte instance, create a new lexical
die for anything below to attach DW_AT_abstract_origin to. */ die for anything below to attach DW_AT_abstract_origin to. */
@ -24109,7 +24091,7 @@ gen_lexical_block_die (tree stmt, dw_die_ref context_die)
/* A non abstract block whose blocks have already been reordered /* A non abstract block whose blocks have already been reordered
should have the instruction range for this block. If so, set the should have the instruction range for this block. If so, set the
high/low attributes. */ high/low attributes. */
if (!early_dwarf && !BLOCK_ABSTRACT (stmt) && TREE_ASM_WRITTEN (stmt)) if (!early_dwarf && TREE_ASM_WRITTEN (stmt))
{ {
gcc_assert (stmt_die); gcc_assert (stmt_die);
add_high_low_attributes (stmt, stmt_die); add_high_low_attributes (stmt, stmt_die);
@ -24123,48 +24105,38 @@ gen_lexical_block_die (tree stmt, dw_die_ref context_die)
static void static void
gen_inlined_subroutine_die (tree stmt, dw_die_ref context_die) gen_inlined_subroutine_die (tree stmt, dw_die_ref context_die)
{ {
tree decl; tree decl = block_ultimate_origin (stmt);
/* The instance of function that is effectively being inlined shall not
be abstract. */
gcc_assert (! BLOCK_ABSTRACT (stmt));
decl = block_ultimate_origin (stmt);
/* Make sure any inlined functions are known to be inlineable. */ /* Make sure any inlined functions are known to be inlineable. */
gcc_checking_assert (DECL_ABSTRACT_P (decl) gcc_checking_assert (DECL_ABSTRACT_P (decl)
|| cgraph_function_possibly_inlined_p (decl)); || cgraph_function_possibly_inlined_p (decl));
if (! BLOCK_ABSTRACT (stmt)) dw_die_ref subr_die = new_die (DW_TAG_inlined_subroutine, context_die, stmt);
if (call_arg_locations || debug_inline_points)
equate_block_to_die (stmt, subr_die);
add_abstract_origin_attribute (subr_die, decl);
if (TREE_ASM_WRITTEN (stmt))
add_high_low_attributes (stmt, subr_die);
add_call_src_coords_attributes (stmt, subr_die);
/* The inliner creates an extra BLOCK for the parameter setup,
we want to merge that with the actual outermost BLOCK of the
inlined function to avoid duplicate locals in consumers.
Do that by doing the recursion to subblocks on the single subblock
of STMT. */
bool unwrap_one = false;
if (BLOCK_SUBBLOCKS (stmt) && !BLOCK_CHAIN (BLOCK_SUBBLOCKS (stmt)))
{ {
dw_die_ref subr_die tree origin = block_ultimate_origin (BLOCK_SUBBLOCKS (stmt));
= new_die (DW_TAG_inlined_subroutine, context_die, stmt); if (origin
&& TREE_CODE (origin) == BLOCK
if (call_arg_locations || debug_inline_points) && BLOCK_SUPERCONTEXT (origin) == decl)
equate_block_to_die (stmt, subr_die); unwrap_one = true;
add_abstract_origin_attribute (subr_die, decl);
if (TREE_ASM_WRITTEN (stmt))
add_high_low_attributes (stmt, subr_die);
add_call_src_coords_attributes (stmt, subr_die);
/* The inliner creates an extra BLOCK for the parameter setup,
we want to merge that with the actual outermost BLOCK of the
inlined function to avoid duplicate locals in consumers.
Do that by doing the recursion to subblocks on the single subblock
of STMT. */
bool unwrap_one = false;
if (BLOCK_SUBBLOCKS (stmt) && !BLOCK_CHAIN (BLOCK_SUBBLOCKS (stmt)))
{
tree origin = block_ultimate_origin (BLOCK_SUBBLOCKS (stmt));
if (origin
&& TREE_CODE (origin) == BLOCK
&& BLOCK_SUPERCONTEXT (origin) == decl)
unwrap_one = true;
}
decls_for_scope (stmt, subr_die, !unwrap_one);
if (unwrap_one)
decls_for_scope (BLOCK_SUBBLOCKS (stmt), subr_die);
} }
decls_for_scope (stmt, subr_die, !unwrap_one);
if (unwrap_one)
decls_for_scope (BLOCK_SUBBLOCKS (stmt), subr_die);
} }
/* Generate a DIE for a field in a record, or structure. CTX is required: see /* Generate a DIE for a field in a record, or structure. CTX is required: see
@ -25663,8 +25635,7 @@ gen_block_die (tree stmt, dw_die_ref context_die)
still want to generate high/low PC attributes so output it. */ still want to generate high/low PC attributes so output it. */
must_output_die = 1; must_output_die = 1;
else if (TREE_USED (stmt) else if (TREE_USED (stmt)
|| TREE_ASM_WRITTEN (stmt) || TREE_ASM_WRITTEN (stmt))
|| BLOCK_ABSTRACT (stmt))
{ {
/* Determine if this block directly contains any "significant" /* Determine if this block directly contains any "significant"
local declarations which we will need to output DIEs for. */ local declarations which we will need to output DIEs for. */
@ -25697,23 +25668,7 @@ gen_block_die (tree stmt, dw_die_ref context_die)
if (must_output_die) if (must_output_die)
{ {
if (inlined_func) if (inlined_func)
{ gen_inlined_subroutine_die (stmt, context_die);
/* If STMT block is abstract, that means we have been called
indirectly from dwarf2out_abstract_function.
That function rightfully marks the descendent blocks (of
the abstract function it is dealing with) as being abstract,
precisely to prevent us from emitting any
DW_TAG_inlined_subroutine DIE as a descendent
of an abstract function instance. So in that case, we should
not call gen_inlined_subroutine_die.
Later though, when cgraph asks dwarf2out to emit info
for the concrete instance of the function decl into which
the concrete instance of STMT got inlined, the later will lead
to the generation of a DW_TAG_inlined_subroutine DIE. */
if (! BLOCK_ABSTRACT (stmt))
gen_inlined_subroutine_die (stmt, context_die);
}
else else
gen_lexical_block_die (stmt, context_die); gen_lexical_block_die (stmt, context_die);
} }

View File

@ -1481,8 +1481,7 @@ struct GTY(()) tree_block {
struct tree_base base; struct tree_base base;
tree chain; tree chain;
unsigned abstract_flag : 1; unsigned block_num;
unsigned block_num : 31;
location_t locus; location_t locus;
location_t end_locus; location_t end_locus;

View File

@ -1124,9 +1124,6 @@ dump_block_node (pretty_printer *pp, tree block, int spc, dump_flags_t flags)
if (flags & TDF_ADDRESS) if (flags & TDF_ADDRESS)
pp_printf (pp, "[%p] ", (void *) block); pp_printf (pp, "[%p] ", (void *) block);
if (BLOCK_ABSTRACT (block))
pp_string (pp, "[abstract] ");
if (TREE_ASM_WRITTEN (block)) if (TREE_ASM_WRITTEN (block))
pp_string (pp, "[written] "); pp_string (pp, "[written] ");

View File

@ -643,9 +643,8 @@ dump_scope_block (FILE *file, int indent, tree scope, dump_flags_t flags)
tree var, t; tree var, t;
unsigned int i; unsigned int i;
fprintf (file, "\n%*s{ Scope block #%i%s%s",indent, "" , BLOCK_NUMBER (scope), fprintf (file, "\n%*s{ Scope block #%i%s",indent, "" , BLOCK_NUMBER (scope),
TREE_USED (scope) ? "" : " (unused)", TREE_USED (scope) ? "" : " (unused)");
BLOCK_ABSTRACT (scope) ? " (abstract)": "");
if (LOCATION_LOCUS (BLOCK_SOURCE_LOCATION (scope)) != UNKNOWN_LOCATION) if (LOCATION_LOCUS (BLOCK_SOURCE_LOCATION (scope)) != UNKNOWN_LOCATION)
{ {
expanded_location s = expand_location (BLOCK_SOURCE_LOCATION (scope)); expanded_location s = expand_location (BLOCK_SOURCE_LOCATION (scope));

View File

@ -398,7 +398,6 @@ static void
unpack_ts_block_value_fields (struct data_in *data_in, unpack_ts_block_value_fields (struct data_in *data_in,
struct bitpack_d *bp, tree expr) struct bitpack_d *bp, tree expr)
{ {
BLOCK_ABSTRACT (expr) = (unsigned) bp_unpack_value (bp, 1);
/* BLOCK_NUMBER is recomputed. */ /* BLOCK_NUMBER is recomputed. */
stream_input_location (&BLOCK_SOURCE_LOCATION (expr), bp, data_in); stream_input_location (&BLOCK_SOURCE_LOCATION (expr), bp, data_in);
} }

View File

@ -344,7 +344,6 @@ static void
pack_ts_block_value_fields (struct output_block *ob, pack_ts_block_value_fields (struct output_block *ob,
struct bitpack_d *bp, tree expr) struct bitpack_d *bp, tree expr)
{ {
bp_pack_value (bp, BLOCK_ABSTRACT (expr), 1);
/* BLOCK_NUMBER is recomputed. */ /* BLOCK_NUMBER is recomputed. */
/* Stream BLOCK_SOURCE_LOCATION for the limited cases we can handle - those /* Stream BLOCK_SOURCE_LOCATION for the limited cases we can handle - those
that represent inlined function scopes. that represent inlined function scopes.

View File

@ -12142,11 +12142,6 @@ block_ultimate_origin (const_tree block)
{ {
tree origin = BLOCK_ABSTRACT_ORIGIN (block); tree origin = BLOCK_ABSTRACT_ORIGIN (block);
/* BLOCK_ABSTRACT_ORIGIN can point to itself; ignore that if
we're trying to output the abstract instance of this function. */
if (BLOCK_ABSTRACT (block) && origin == block)
return NULL_TREE;
if (origin == NULL_TREE) if (origin == NULL_TREE)
return NULL_TREE; return NULL_TREE;
else else

View File

@ -70,9 +70,6 @@ DEFTREECODE (TREE_VEC, "tree_vec", tcc_exceptional, 0)
could either point to another BLOCK node or it could point to a could either point to another BLOCK node or it could point to a
FUNCTION_DECL node (e.g. in the case of a block representing the FUNCTION_DECL node (e.g. in the case of a block representing the
outermost scope of a particular inlining of a function). outermost scope of a particular inlining of a function).
BLOCK_ABSTRACT is nonzero if the block represents an abstract
instance of a block (i.e. one which is nested within an abstract
instance of an inline function).
TREE_ASM_WRITTEN is nonzero if the block was actually referenced TREE_ASM_WRITTEN is nonzero if the block was actually referenced
in the generated assembly. */ in the generated assembly. */
DEFTREECODE (BLOCK, "block", tcc_exceptional, 0) DEFTREECODE (BLOCK, "block", tcc_exceptional, 0)

View File

@ -1791,7 +1791,6 @@ extern tree maybe_wrap_with_location (tree, location_t);
#define BLOCK_ABSTRACT_ORIGIN(NODE) (BLOCK_CHECK (NODE)->block.abstract_origin) #define BLOCK_ABSTRACT_ORIGIN(NODE) (BLOCK_CHECK (NODE)->block.abstract_origin)
#define BLOCK_ORIGIN(NODE) \ #define BLOCK_ORIGIN(NODE) \
(BLOCK_ABSTRACT_ORIGIN(NODE) ? BLOCK_ABSTRACT_ORIGIN(NODE) : (NODE)) (BLOCK_ABSTRACT_ORIGIN(NODE) ? BLOCK_ABSTRACT_ORIGIN(NODE) : (NODE))
#define BLOCK_ABSTRACT(NODE) (BLOCK_CHECK (NODE)->block.abstract_flag)
#define BLOCK_DIE(NODE) (BLOCK_CHECK (NODE)->block.die) #define BLOCK_DIE(NODE) (BLOCK_CHECK (NODE)->block.die)
/* True if BLOCK has the same ranges as its BLOCK_SUPERCONTEXT. */ /* True if BLOCK has the same ranges as its BLOCK_SUPERCONTEXT. */