LTO has a mechanism not to stream out common nodes that are expected to
be identical on each run. When using LTO to communicate between
compilers for different targets, the va_list_type_node and related ones
must be excluded from this.
Richard B mentioned in a recent mail that the i386 backend uses direct
comparisons to va_list_type_node. After investigating a bit it seems to
me that this is not actually a problem: what's being compared is the
return value of ix86_canonical_va_list_type, which always chooses one of
va_list_type_node or its ABI variants, so the comparison should hold
even with this patch.
Bootstrapped and tested on x86_64-linux, ok?
Bernd
* tre-streamer.c (preload_common_nodes): Skip TI_VA_LIST_TYPE and
related nodes.
Index: gcc/tree-streamer.c
===================================================================
--- gcc/tree-streamer.c.orig
+++ gcc/tree-streamer.c
@@ -309,10 +309,14 @@ preload_common_nodes (struct streamer_tr
record_common_node (cache, sizetype_tab[i]);
for (i = 0; i < TI_MAX; i++)
- /* Skip boolean type and constants, they are frontend dependent. */
+ /* Skip boolean type and constants, they are frontend dependent.
+ Skip va_list types, target dependent and may not survive offloading. */
if (i != TI_BOOLEAN_TYPE
&& i != TI_BOOLEAN_FALSE
- && i != TI_BOOLEAN_TRUE)
+ && i != TI_BOOLEAN_TRUE
+ && i != TI_VA_LIST_TYPE
+ && i != TI_VA_LIST_GPR_COUNTER_FIELD
+ && i != TI_VA_LIST_FPR_COUNTER_FIELD)
record_common_node (cache, global_trees[i]);
}