[Bug c++/87229] [8/9 Regression] ICE: tree code 'call_expr' is not supported in LTO streams

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Nov 19 08:26:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87229

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |lto
             Status|NEW                         |ASSIGNED
                 CC|                            |jason at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
It's really a C++ FE thing - it seems to have a copy of the functions just for
abstract origin purposes?  That will end up with less than optimal debug info
for the VLA case (VLAs are a GNU extension here though).  gimplifying the
unused abstract copy won't do any good either (to debuginfo), so I'm not sure
what is best to do here.  Note this "unused" function even has a struct
function,
and it is the local_decls where we pick up the non-gimplifed decl.

Well, I of course know - _not_ stream DECL_ABSTRACT_ORIGIN as tree but as
DIE reference.  That's my long-term plan.  But it's somewhat hard to do
(well, the fallout is quite big).

I guess I'll try again (for GCC9).

For GCC8 for this testcase we could add some "hacks" to avoid streaming
non-gimplified sizes like the following which I am going to test now.

diff --git a/gcc/tree.c b/gcc/tree.c
index be89897d43a..48de9cf350f 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -5254,6 +5254,13 @@ free_lang_data_in_one_sizepos (tree *expr_p)
   tree expr = *expr_p;
   if (CONTAINS_PLACEHOLDER_P (expr))
     *expr_p = build0 (PLACEHOLDER_EXPR, TREE_TYPE (expr));
+  /* ???  We have to reset all non-GIMPLE sizepos because those eventually
+     refer to trees we cannot stream.  See for example PR87229 which
+     shows an example with non-gimplified abstract origins in C++.
+     Note this should only happen for abstract copies so setting sizes
+     to NULL is OK (but we cannot easily assert this).  */
+  else if (expr && !is_gimple_val (expr))
+    *expr_p = NULL_TREE;
 }


More information about the Gcc-bugs mailing list