aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2018-02-27 03:37:10 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2018-02-27 03:37:10 +0000
commit9893273d9826229c41075f568f343bfc7c32d9dd (patch)
tree85cc7bd6adb42b040f959121d5f5e438d796e982 /gcc
parented75f594a9afd438bd652136f7606d32a7f1a515 (diff)
downloadgcc-9893273d9826229c41075f568f343bfc7c32d9dd.zip
gcc-9893273d9826229c41075f568f343bfc7c32d9dd.tar.gz
gcc-9893273d9826229c41075f568f343bfc7c32d9dd.tar.bz2
[IEPM] don't preserve lexical blocks just for debug inline markers
This patch stops preserving scope blocks just because they are inlined function scopes, when cleaning up unused scope blocks. This change was introduced along with IEPM, but it preserved lots of blocks, and output debug information for them, although no code from the inlined function remained after optimization. The additional preserved blocks took up compile-time memory, and significant disk space and link time, in some cases more than 25%. This is deemed excessive, compared with the reasonably small benefit of allowing one to single-step into an inlined function using a view-capable debugger. There was another way of marking inlined function scopes as unused, based on the markers referencing them during stmt scanning, but that still preserved too much. So, this patch restores the pre-IEPM logic of preservation of scopes. Should a scope block referenced by an inline entry marker be found to be unused in remove_unused_scope_block_p, the marker will be cleaned up right after that, in clear_unused_block_pointer, so we won't keep a dangling reference to a dropped block. for gcc/ChangeLog * tree-ssa-live.c (remove_unused_scope_block_p): Do not preserve inline entry blocks for the sake of debug inline entry point markers alone. (remove_unused_locals): Suggest in comments a better place to force the preservation of inline entry blocks that are otherwise unused, but do not preserve them. From-SVN: r258026
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/tree-ssa-live.c15
2 files changed, 15 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a3e3869..994340a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2018-02-27 Alexandre Oliva <aoliva@redhat.com>
+
+ * tree-ssa-live.c (remove_unused_scope_block_p): Do not
+ preserve inline entry blocks for the sake of debug inline
+ entry point markers alone.
+ (remove_unused_locals): Suggest in comments a better place to
+ force the preservation of inline entry blocks that are
+ otherwise unused, but do not preserve them.
+
2018-02-26 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.c (ix86_output_indirect_jmp): Update comments.
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index 62bb3c5..62316ba 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -520,11 +520,6 @@ remove_unused_scope_block_p (tree scope, bool in_ctor_dtor_block)
else if (!BLOCK_SUPERCONTEXT (scope)
|| TREE_CODE (BLOCK_SUPERCONTEXT (scope)) == FUNCTION_DECL)
unused = false;
- /* Preserve the block, it is referenced by at least the inline
- entry point marker. */
- else if (debug_inline_points
- && inlined_function_outer_scope_p (scope))
- unused = false;
/* Innermost blocks with no live variables nor statements can be always
eliminated. */
else if (!nsubblocks)
@@ -556,10 +551,8 @@ remove_unused_scope_block_p (tree scope, bool in_ctor_dtor_block)
/* See if this block is important for representation of inlined
function. Inlined functions are always represented by block
with block_ultimate_origin being set to FUNCTION_DECL and
- DECL_SOURCE_LOCATION set, unless they expand to nothing... But
- see above for the case of statement frontiers. */
- else if (!debug_inline_points
- && inlined_function_outer_scope_p (scope))
+ DECL_SOURCE_LOCATION set, unless they expand to nothing... */
+ else if (inlined_function_outer_scope_p (scope))
unused = false;
else
/* Verfify that only blocks with source location set
@@ -741,6 +734,10 @@ remove_unused_locals (void)
gimple *stmt = gsi_stmt (gsi);
tree b = gimple_block (stmt);
+ /* If we wanted to mark the block referenced by the inline
+ entry point marker as used, this would be a good spot to
+ do it. If the block is not otherwise used, the stmt will
+ be cleaned up in clean_unused_block_pointer. */
if (is_gimple_debug (stmt))
continue;