+2020-05-25 Jan Hubicka <hubicka@ucw.cz>
+
+ * lto-streamer-out.c (lto_output_tree): Add streamer_debugging check.
+ * lto-streamer.h (streamer_debugging): New constant
+ * tree-streamer-in.c (streamer_read_tree_bitfields): Add
+ streamer_debugging check.
+ (streamer_get_pickled_tree): Likewise.
+ * tree-streamer-out.c (pack_ts_base_value_fields): Likewise.
+
2020-05-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/95308
will instantiate two different nodes for the same object. */
streamer_write_record_start (ob, LTO_tree_pickle_reference);
streamer_write_uhwi (ob, ix);
- streamer_write_enum (ob->main_stream, LTO_tags, LTO_NUM_TAGS,
- lto_tree_code_to_tag (TREE_CODE (expr)));
+ if (streamer_debugging)
+ streamer_write_enum (ob->main_stream, LTO_tags, LTO_NUM_TAGS,
+ lto_tree_code_to_tag (TREE_CODE (expr)));
lto_stats.num_pickle_refs_output++;
}
else
typedef unsigned char lto_decl_flags_t;
+/* Stream additional data to LTO object files to make it easier to debug
+ streaming code. This changes object files. */
+static const bool streamer_debugging = false;
/* Tags representing the various IL objects written to the bytecode file
(GIMPLE statements, basic blocks, EH regions, tree nodes, etc).
/* The first word in BP contains the code of the tree that we
are about to read. */
- code = (enum tree_code) bp_unpack_value (&bp, 16);
- lto_tag_check (lto_tree_code_to_tag (code),
- lto_tree_code_to_tag (TREE_CODE (expr)));
+ if (streamer_debugging)
+ {
+ code = (enum tree_code) bp_unpack_value (&bp, 16);
+ lto_tag_check (lto_tree_code_to_tag (code),
+ lto_tree_code_to_tag (TREE_CODE (expr)));
+ }
+ code = TREE_CODE (expr);
/* Note that all these functions are highly sensitive to changes in
the types and sizes of each of the fields being packed. */
enum LTO_tags expected_tag;
ix = streamer_read_uhwi (ib);
- expected_tag = streamer_read_enum (ib, LTO_tags, LTO_NUM_TAGS);
-
result = streamer_tree_cache_get_tree (data_in->reader_cache, ix);
- gcc_assert (result
- && TREE_CODE (result) == lto_tag_to_tree_code (expected_tag));
+
+ if (streamer_debugging)
+ {
+ expected_tag = streamer_read_enum (ib, LTO_tags, LTO_NUM_TAGS);
+ gcc_assert (result
+ && TREE_CODE (result) == lto_tag_to_tree_code (expected_tag));
+ }
return result;
}
static inline void
pack_ts_base_value_fields (struct bitpack_d *bp, tree expr)
{
- bp_pack_value (bp, TREE_CODE (expr), 16);
+ if (streamer_debugging)
+ bp_pack_value (bp, TREE_CODE (expr), 16);
if (!TYPE_P (expr))
{
bp_pack_value (bp, TREE_SIDE_EFFECTS (expr), 1);