From a8cae5c50ccfd7e69634c6716c3b29cfbec312d6 Mon Sep 17 00:00:00 2001 From: rguenth Date: Wed, 26 Mar 2014 09:47:36 +0000 Subject: [PATCH] 2014-03-26 Richard Biener * tree-pretty-print.c (percent_K_format): Implement special case for LTO and its stripped down BLOCK tree. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208843 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/tree-pretty-print.c | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7faec43..53d58b3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-03-26 Richard Biener + + * tree-pretty-print.c (percent_K_format): Implement special + case for LTO and its stripped down BLOCK tree. + 2014-03-26 Jakub Jelinek PR sanitizer/60636 diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c index 7ec4223..77446c5 100644 --- a/gcc/tree-pretty-print.c +++ b/gcc/tree-pretty-print.c @@ -3365,6 +3365,25 @@ percent_K_format (text_info *text) gcc_assert (pp_ti_abstract_origin (text) != NULL); block = TREE_BLOCK (t); *pp_ti_abstract_origin (text) = NULL; + + if (in_lto_p) + { + /* ??? LTO drops all BLOCK_ABSTRACT_ORIGINs apart from those + representing the outermost block of an inlined function. + So walk the BLOCK tree until we hit such a scope. */ + while (block + && TREE_CODE (block) == BLOCK) + { + if (inlined_function_outer_scope_p (block)) + { + *pp_ti_abstract_origin (text) = block; + break; + } + block = BLOCK_SUPERCONTEXT (block); + } + return; + } + while (block && TREE_CODE (block) == BLOCK && BLOCK_ABSTRACT_ORIGIN (block)) -- 2.7.4