This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][LTO] Disable streamer debugging by default


On Thu, Aug 20, 2009 at 6:13 PM, Richard Guenther<rguenther@suse.de> wrote:
> Index: gcc/lto-streamer-out.c
> ===================================================================
> *** gcc/lto-streamer-out.c ? ? ?(revision 150943)
> --- gcc/lto-streamer-out.c ? ? ?(working copy)
> *************** lto_output_tree_header (struct output_bl
> *** 1321,1332 ****
> --- 1321,1335 ----
> ? ?output_uleb128 (ob, tree_size (expr));
> ? ?output_sleb128 (ob, ix);
>
> + ? /* The following will cause bootstrap miscomparisons. ?Enable with care. ?*/
> + #ifdef LTO_STREAMER_DEBUG
> ? ?/* This is used mainly for debugging purposes. ?When the reader
> ? ? ? and the writer do not agree on a streamed node, the pointer
> ? ? ? value for EXPR can be used to track down the differences in
> ? ? ? the debugger. ?*/
> ? ?gcc_assert ((HOST_WIDEST_INT) (intptr_t) expr == (intptr_t) expr);
> ? ?output_sleb128 (ob, (HOST_WIDEST_INT) (intptr_t) expr);
> + #endif
>

> Index: gcc/lto-streamer-in.c
> ===================================================================
> *** gcc/lto-streamer-in.c ? ? ? (revision 150943)
> --- gcc/lto-streamer-in.c ? ? ? (working copy)
(...)
> *************** lto_materialize_tree (struct lto_input_b
> *** 1722,1732 ****
> --- 1724,1736 ----
> ? ?gcc_assert ((int) ix == ix);
> ? ?*ix_p = (int) ix;
>
> + #ifdef LTO_STREAMER_DEBUG
> ? ?/* Read the word representing the memory address for the tree
> ? ? ? as it was written by the writer. ?This is useful when
> ? ? ? debugging differences between the writer and reader. ?*/
> ? ?orig_address_in_writer = lto_input_sleb128 (ib);
> ? ?gcc_assert ((intptr_t) orig_address_in_writer == orig_address_in_writer);
> + #endif
>
> ? ?code = lto_tag_to_tree_code (tag);
>


Maybe write out / read in the sleb128 regardless of
LTO_STREAMER_DEBUG, but just not do the gcc_assert?  That way, you
should also be able to cmp  the output of an
LTO_STREAMER_DEBUG-enabled compiler with the output of an
LTO_STREAMER_DEBUG-disabled compiler?

Ciao!
Steven


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]