aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-streamer-out.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2010-09-01 17:03:56 +0000
committerAndi Kleen <ak@gcc.gnu.org>2010-09-01 17:03:56 +0000
commit427eb57db6fd5cd7e46da432e2ea46dc1be92905 (patch)
tree064dbf63a148604e479e053c3b0c4f5af02cbefa /gcc/lto-streamer-out.c
parentf39168b3e7d50cf6d35020923b5a40164ad7b155 (diff)
downloadgcc-427eb57db6fd5cd7e46da432e2ea46dc1be92905.zip
gcc-427eb57db6fd5cd7e46da432e2ea46dc1be92905.tar.gz
gcc-427eb57db6fd5cd7e46da432e2ea46dc1be92905.tar.bz2
re PR target/45475 (target attribute use in libcpp breaks LTO bootstrap)
2010-09-01 Andi Kleen <ak@linux.intel.com> PR lto/45475 * lto-streamer-in.c (lto_input_ts_target_option): Add. (lto_input_tree_pointers): Call lto_input_ts_target_option. * lto-streamer-out: (lto_output_ts_target_option): Add. (lto_output_tree_pointers): Call lto_output_ts_target_option. From-SVN: r163740
Diffstat (limited to 'gcc/lto-streamer-out.c')
-rw-r--r--gcc/lto-streamer-out.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index dde86b9..80d818c 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -1105,6 +1105,26 @@ lto_output_ts_constructor_tree_pointers (struct output_block *ob, tree expr,
}
}
+/* Write a TS_TARGET_OPTION tree in EXPR to OB. */
+
+static void
+lto_output_ts_target_option (struct output_block *ob, tree expr)
+{
+ struct cl_target_option *t = TREE_TARGET_OPTION (expr);
+ struct bitpack_d bp;
+ unsigned i, len;
+
+ /* The cl_target_option is target specific and generated by the options
+ awk script, so we just recreate a byte-by-byte copy here. */
+
+ bp = bitpack_create (ob->main_stream);
+ len = sizeof (struct cl_target_option);
+ for (i = 0; i < len; i++)
+ bp_pack_value (&bp, ((unsigned char *)t)[i], 8);
+ /* Catch struct size mismatches between reader and writer. */
+ bp_pack_value (&bp, 0x12345678, 32);
+ lto_output_bitpack (&bp);
+}
/* Helper for lto_output_tree. Write all pointer fields in EXPR to output
block OB. If REF_P is true, the leaves of EXPR are emitted as
@@ -1187,7 +1207,7 @@ lto_output_tree_pointers (struct output_block *ob, tree expr, bool ref_p)
sorry ("gimple bytecode streams do not support the optimization attribute");
if (CODE_CONTAINS_STRUCT (code, TS_TARGET_OPTION))
- sorry ("gimple bytecode streams do not support the target attribute");
+ lto_output_ts_target_option (ob, expr);
}