This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[lto] fix stmt.c:expand_return ICE


Hopefully, this is the last flag we have to worry about serializing
correctly.

The cause of the ICE is that variables of COMPLEX type were not getting
this flag set correctly--specifically RESULT_DECLs of COMPLEX type. As a
result, RETURN_EXPRs with GIMPLE_MODIFY_STMTs setting SSA_NAMEs or
RESULT_DECLs (whew!) were not being given real SSA operands correctly.
Which, in turn, meant that the out-of-ssa pass didn't realize that the
RETURN_EXPR contained SSA_NAMEs that needed to be changed, ultimately
leading to expand_return receiving something it did not expect to see.

The FIXME is a note for reminding us what we will want to do later.

Committed to the LTO branch.

-Nathan

gcc/
	* lto-tree-flags.def (RESULT_DECL): Add gimple_reg_flag.

gcc/lto/
	* lto.c (lto_materialize_function): Add FIXME.

Index: gcc/lto-tree-flags.def
===================================================================
--- gcc/lto-tree-flags.def	(revision 130517)
+++ gcc/lto-tree-flags.def	(working copy)
@@ -586,6 +586,7 @@
     END_EXPR_CASE (REFERENCE_TYPE)
       
     START_EXPR_CASE (RESULT_DECL)
+      ADD_DECL_FLAG (gimple_reg_flag)
     END_EXPR_CASE (RESULT_DECL)
       
     START_EXPR_CASE (RESX_EXPR)
Index: gcc/lto/lto.c
===================================================================
--- gcc/lto/lto.c	(revision 130517)
+++ gcc/lto/lto.c	(working copy)
@@ -2417,6 +2417,15 @@ lto_materialize_function (lto_info_fd *f
   if (body)
     {
       /* cgraph expects this to be called once for each function.  */
+      /* FIXME: eventually, reading LTO files should rebuild SSA
+	 perfectly so that things like the extra referenced_vars pass
+	 and rebuild_ssa_for_lto can go away.  Before that happens, this
+	 call needs to be moved earlier in the materialization
+	 process--probably to lto-read.c:input_cfg or before.  We could
+	 move it there now, but the current state means that we would do
+	 useless work while reading in LTO files--building SSA operands
+	 once while reading and then rebuilding again during
+	 rebuild_ssa_for_lto.  */
       init_ssa_operands ();
 
       cgraph_finalize_function (decl, /*nested=*/false);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]