> On Mon, 15 Dec 2014, Jan Hubicka wrote:
> 
> > Hi, actually this patch break fortran, I get streaming error in: lto1: 
> > internal compiler error: in streamer_get_pickled_tree apparently picking 
> > error_mark_node for variable constructor results in reading 
> > integer_type...
> 
> ?
> 
> Probably the default nodes are referenced by another builtin tree instead
> and you get inconsistent streaming between f951 and lto1.  See the
> assert placed into record_common_node which you should extend to cover
> the optimization node trees.

It seems that whole common node preloading is a major can of worms ;(. Anyway
the problem here is that record_common_node replaces every NULL by 
error_mark_node.
It thus matters what is the last NULL pointer recorded.  It used to be 
TI_CURRENT_OPTIMIZE_PRAGMA
but now it is TI_PID_TYPE in some cases, TI_MAIN_IDENTIFIER in others and
real error_mark_node in rest of cases.

I am testing the following.
Honza

Index: tree-streamer.c
===================================================================
--- tree-streamer.c     (revision 218726)
+++ tree-streamer.c     (working copy)
@@ -324,7 +324,18 @@ preload_common_nodes (struct streamer_tr
     /* Skip boolean type and constants, they are frontend dependent.  */
     if (i != TI_BOOLEAN_TYPE
        && i != TI_BOOLEAN_FALSE
-       && i != TI_BOOLEAN_TRUE)
+       && i != TI_BOOLEAN_TRUE
+       /* MAIN_IDENTIFIER is not always initialized by Fortran FE.  */
+       && i != TI_MAIN_IDENTIFIER
+       /* PID_TYPE is initialized only by C family front-ends.  */
+       && i != TI_PID_TYPE
+       /* Skip optimization and target option nodes; they depend on flags.  */
+       && i != TI_OPTIMIZATION_DEFAULT
+       && i != TI_OPTIMIZATION_CURRENT
+       && i != TI_TARGET_OPTION_DEFAULT
+       && i != TI_TARGET_OPTION_CURRENT
+       && i != TI_CURRENT_TARGET_PRAGMA
+       && i != TI_CURRENT_OPTIMIZE_PRAGMA)
       record_common_node (cache, global_trees[i]);
 }
 

Reply via email to