From: Richard Biener Date: Fri, 5 Oct 2018 11:46:12 +0000 (+0000) Subject: tree-core.h (tree_block::abstract_flag): Remove. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=700adeb6fd65528758f9dbcd0aaf6345e14d312c;p=gcc.git tree-core.h (tree_block::abstract_flag): Remove. 2018-10-05 Richard Biener * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b8d4c9cbb7c..087a37dd562 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,20 @@ +2018-10-05 Richard Biener + + * 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 * config/i386/i386.c (ix86_add_stmt_cost): When scalar cost diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index a63a645e84a..0772b364919 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -24009,7 +24009,7 @@ add_high_low_attributes (tree stmt, dw_die_ref die) } if (attr != NULL && ((*ranges_table)[attr->dw_attr_val.v.val_offset].num - == BLOCK_NUMBER (superblock)) + == (int)BLOCK_NUMBER (superblock)) && BLOCK_FRAGMENT_CHAIN (superblock)) { 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; 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); 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); } - if (BLOCK_ABSTRACT (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 (BLOCK_ABSTRACT_ORIGIN (stmt)) { /* If this is an inlined or conrecte instance, create a new lexical 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 should have the instruction range for this block. If so, set the high/low attributes. */ - if (!early_dwarf && !BLOCK_ABSTRACT (stmt) && TREE_ASM_WRITTEN (stmt)) + if (!early_dwarf && TREE_ASM_WRITTEN (stmt)) { gcc_assert (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 gen_inlined_subroutine_die (tree stmt, dw_die_ref context_die) { - tree decl; - - /* The instance of function that is effectively being inlined shall not - be abstract. */ - gcc_assert (! BLOCK_ABSTRACT (stmt)); - - decl = block_ultimate_origin (stmt); + tree decl = block_ultimate_origin (stmt); /* Make sure any inlined functions are known to be inlineable. */ gcc_checking_assert (DECL_ABSTRACT_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); + 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); + 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))) - { - 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); + /* 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); } /* 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. */ must_output_die = 1; else if (TREE_USED (stmt) - || TREE_ASM_WRITTEN (stmt) - || BLOCK_ABSTRACT (stmt)) + || TREE_ASM_WRITTEN (stmt)) { /* Determine if this block directly contains any "significant" 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 (inlined_func) - { - /* 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); - } + gen_inlined_subroutine_die (stmt, context_die); else gen_lexical_block_die (stmt, context_die); } diff --git a/gcc/tree-core.h b/gcc/tree-core.h index cd3a2bad08c..7df5c40a3a4 100644 --- a/gcc/tree-core.h +++ b/gcc/tree-core.h @@ -1481,8 +1481,7 @@ struct GTY(()) tree_block { struct tree_base base; tree chain; - unsigned abstract_flag : 1; - unsigned block_num : 31; + unsigned block_num; location_t locus; location_t end_locus; diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c index 75b939a9418..81414d117e1 100644 --- a/gcc/tree-pretty-print.c +++ b/gcc/tree-pretty-print.c @@ -1124,9 +1124,6 @@ dump_block_node (pretty_printer *pp, tree block, int spc, dump_flags_t flags) if (flags & TDF_ADDRESS) pp_printf (pp, "[%p] ", (void *) block); - if (BLOCK_ABSTRACT (block)) - pp_string (pp, "[abstract] "); - if (TREE_ASM_WRITTEN (block)) pp_string (pp, "[written] "); diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c index eee21a63bd7..3febde886d0 100644 --- a/gcc/tree-ssa-live.c +++ b/gcc/tree-ssa-live.c @@ -643,9 +643,8 @@ dump_scope_block (FILE *file, int indent, tree scope, dump_flags_t flags) tree var, t; unsigned int i; - fprintf (file, "\n%*s{ Scope block #%i%s%s",indent, "" , BLOCK_NUMBER (scope), - TREE_USED (scope) ? "" : " (unused)", - BLOCK_ABSTRACT (scope) ? " (abstract)": ""); + fprintf (file, "\n%*s{ Scope block #%i%s",indent, "" , BLOCK_NUMBER (scope), + TREE_USED (scope) ? "" : " (unused)"); if (LOCATION_LOCUS (BLOCK_SOURCE_LOCATION (scope)) != UNKNOWN_LOCATION) { expanded_location s = expand_location (BLOCK_SOURCE_LOCATION (scope)); diff --git a/gcc/tree-streamer-in.c b/gcc/tree-streamer-in.c index 8d8f8695718..bd98ed0b128 100644 --- a/gcc/tree-streamer-in.c +++ b/gcc/tree-streamer-in.c @@ -398,7 +398,6 @@ static void unpack_ts_block_value_fields (struct data_in *data_in, struct bitpack_d *bp, tree expr) { - BLOCK_ABSTRACT (expr) = (unsigned) bp_unpack_value (bp, 1); /* BLOCK_NUMBER is recomputed. */ stream_input_location (&BLOCK_SOURCE_LOCATION (expr), bp, data_in); } diff --git a/gcc/tree-streamer-out.c b/gcc/tree-streamer-out.c index 60ec1788bf3..7f97c40277a 100644 --- a/gcc/tree-streamer-out.c +++ b/gcc/tree-streamer-out.c @@ -344,7 +344,6 @@ static void pack_ts_block_value_fields (struct output_block *ob, struct bitpack_d *bp, tree expr) { - bp_pack_value (bp, BLOCK_ABSTRACT (expr), 1); /* BLOCK_NUMBER is recomputed. */ /* Stream BLOCK_SOURCE_LOCATION for the limited cases we can handle - those that represent inlined function scopes. diff --git a/gcc/tree.c b/gcc/tree.c index d7dca77d2b2..f87bc373f56 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -12142,11 +12142,6 @@ block_ultimate_origin (const_tree 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) return NULL_TREE; else diff --git a/gcc/tree.def b/gcc/tree.def index a6882d9288d..78b499a1d21 100644 --- a/gcc/tree.def +++ b/gcc/tree.def @@ -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 FUNCTION_DECL node (e.g. in the case of a block representing the 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 in the generated assembly. */ DEFTREECODE (BLOCK, "block", tcc_exceptional, 0) diff --git a/gcc/tree.h b/gcc/tree.h index 1e59dd59cf3..2e45f9db2e3 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -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_ORIGIN(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) /* True if BLOCK has the same ranges as its BLOCK_SUPERCONTEXT. */