Ugly LTO hacks. To be nuked. See http://gcc.gnu.org/ml/gcc-patches/2011-03/msg01556.html for details.
Diego. * lto-streamer-in.c (lto_input_ts_decl_non_common_tree_pointers): Always read DECL_SAVED_TREE. * lto-streamer-out.c (lto_output_ts_decl_common_tree_pointers): Igonore varpool nodes. (lto_output_ts_decl_non_common_tree_pointers): Output NULL DECL_SAVED_TREE. diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c index b86008b..d2f0075 100644 --- a/gcc/lto-streamer-in.c +++ b/gcc/lto-streamer-in.c @@ -2025,6 +2028,10 @@ lto_input_ts_decl_non_common_tree_pointers (struct lto_input_block *ib, { if (TREE_CODE (expr) == FUNCTION_DECL) { + /* FIXME pph - Hookize. */ +#if 1 + DECL_SAVED_TREE (expr) = lto_input_tree (ib, data_in); +#endif DECL_ARGUMENTS (expr) = lto_input_tree (ib, data_in); DECL_RESULT (expr) = lto_input_tree (ib, data_in); } diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c index a66e1fb..d3d8294 100644 --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -854,6 +848,8 @@ lto_output_ts_decl_common_tree_pointers (struct output_block *ob, tree expr, && TREE_CODE (expr) != TRANSLATION_UNIT_DECL) { tree initial = DECL_INITIAL (expr); + /* FIXME pph - Hookize. */ +#if 0 if (TREE_CODE (expr) == VAR_DECL && (TREE_STATIC (expr) || DECL_EXTERNAL (expr)) && initial) @@ -866,6 +862,7 @@ lto_output_ts_decl_common_tree_pointers (struct output_block *ob, tree expr, vnode)) initial = NULL; } +#endif lto_output_tree_or_ref (ob, initial, ref_p); } @@ -898,11 +895,16 @@ lto_output_ts_decl_non_common_tree_pointers (struct output_block *ob, { if (TREE_CODE (expr) == FUNCTION_DECL) { +#if 0 /* DECL_SAVED_TREE holds the GENERIC representation for DECL. At this point, it should not exist. Either because it was converted to gimple or because DECL didn't have a GENERIC representation in this TU. */ gcc_assert (DECL_SAVED_TREE (expr) == NULL_TREE); +#else + /* FIXME pph - Hookize and handle FE ASTs. */ + lto_output_tree_or_ref (ob, NULL, ref_p); +#endif lto_output_tree_or_ref (ob, DECL_ARGUMENTS (expr), ref_p); lto_output_tree_or_ref (ob, DECL_RESULT (expr), ref_p); } -- This patch is available for review at http://codereview.appspot.com/4303049