tree-streamer.c (preload_common_nodes): Don't preload TI_VA_LIST* for offloading.
authorBernd Schmidt <bernds@codesourcery.com>
Fri, 20 Feb 2015 10:01:17 +0000 (10:01 +0000)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 20 Feb 2015 10:01:17 +0000 (11:01 +0100)
* tree-streamer.c (preload_common_nodes): Don't preload
TI_VA_LIST* for offloading.
* tree-stdarg.c (pass_stdarg::gate): Disable for ACCEL_COMPILER
in_lto_p.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r220846

gcc/ChangeLog
gcc/tree-stdarg.c
gcc/tree-streamer.c

index f36328e673dfd4f97e9acb199ea0838474fe9037..ff6df3df9f1441e08abfdec8fc61eefa0ce4318c 100644 (file)
@@ -1,3 +1,11 @@
+2015-02-20  Bernd Schmidt  <bernds@codesourcery.com>
+           Jakub Jelinek  <jakub@redhat.com>
+
+       * tree-streamer.c (preload_common_nodes): Don't preload
+       TI_VA_LIST* for offloading.
+       * tree-stdarg.c (pass_stdarg::gate): Disable for ACCEL_COMPILER
+       in_lto_p.
+
 2015-02-19  John David Anglin  <danlgin@gcc.gnu.org>
 
        * config/pa/pa.c (pa_emit_move_sequence): Always force
index 17d51a20fd31458cc05a071994c56415ee15625a..0c70790f3eb875609716a37cf1df19e8019001b3 100644 (file)
@@ -705,6 +705,13 @@ public:
   virtual bool gate (function *fun)
     {
       return (flag_stdarg_opt
+#ifdef ACCEL_COMPILER
+             /* Disable for GCC5 in the offloading compilers, as
+                va_list and gpr/fpr counter fields are not merged.
+                In GCC6 when stdarg is lowered late this shouldn't be
+                an issue.  */
+             && !in_lto_p
+#endif
              /* This optimization is only for stdarg functions.  */
              && fun->stdarg != 0);
     }
index 8f597aad0cbb9572e93e1d5407b2954c2d15df5e..7b35358c280dda6b119dcea89caf4efcc821b118 100644 (file)
@@ -342,7 +342,14 @@ preload_common_nodes (struct streamer_tree_cache_d *cache)
        && i != TI_TARGET_OPTION_DEFAULT
        && i != TI_TARGET_OPTION_CURRENT
        && i != TI_CURRENT_TARGET_PRAGMA
-       && i != TI_CURRENT_OPTIMIZE_PRAGMA)
+       && i != TI_CURRENT_OPTIMIZE_PRAGMA
+       /* Skip va_list* related nodes if offloading.  For native LTO
+          we want them to be merged for the stdarg pass, for offloading
+          they might not be identical between host and offloading target.  */
+       && (!lto_stream_offload_p
+           || (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]);
 }