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: [lto]: merge from trunk


On Mon, Jul 14, 2008 at 12:06 AM, Bill Maddox <maddox@google.com> wrote:
> I've done some analysis of this bug.  The failure appears to be caused
> by the following lines in builtings.c (std_canonical_list_type):
>
> wtype = va_list_type_node;
> htype = type;
> /* ... */
> if (TYPE_MAIN_VARIANT (wtype) == TYPE_MAIN_VARIANT (htype))
>    return va_list_type_node;
>
> Here, we are expecting the "well-known" type va_list_type_node,
> stashed away in a global variable during compiler initialization by
> both cc1 and lto1, to share substructure (the TYPE_MAIN_VARIANT) with
> that of a type that has been internalized from a stream.

Here is a patch that corrects this problem.  It reorganizes the preloading of
well-known nodes in the streamer, and preloads the TYPE_MAIN_VARIANT of
well-known type nodes as well.  It is a step on the way to proper sharing of
all of the node graph subsidiary to the well-known nodes.
The patch is mostly due to Diego, however, he was unable to complete it
before travelling, and handed it off to me to finish debugging.  This should
correct the many assertion failures we've been seeing in stabilize_va_list
since a recent merge with mainline.

gcc:

        * tree-pretty-print.c (dump_generic_node):  Suppress display of
        structure fields with TDF_SLIM flag.
        fields even if structure is named.
        (print_struct_decl): Test correctly for direct self-reference
        or self-reference via a pointer type.
        * tree.c (free_lang_specifics): Set ptrdiff_type_node to
        integer_type_node, independent of the front-end.
        * lto-function-out.c (output_tree): Improve streamer tracing.
        Factor out code for keeping hash table of streamed nodes for
        sharing purposes, moved to new function get_ref_idx_for.
        * lto-function-in.c (input_tree_operand): Improve streamer tracing.
        * lto-tree-out.h (struct output_block): Remove field next_main_index.
        * tree-flow.h (tree_node_can_be_shared): Declare.
        * tree-cfg.c (tree_node_can_be_shared): Make non-static.
        * lto-section-out.c: Remove unnecessary header file inclusions.
        (get_ref_idx_for): New function.
        (preload_common_node): New version can be shared by reader and writer,
        also preloads TYPE_MAIN_VARIANT field of preloaded types.
        (preload_common_nodes): Use new preload_common_node.  New tracing code.
        * lto-section-out.h (preload_common_node, get_ref

gcc/lto:

        * lto.c: Reorder file inclusions.  Include lto-section-out.h.
        (preload_common_nodes): Use new shared preload_common_node.
        Improved streamer tracing.
        * Make-lang.in: Make lto.o depend on lto-section-out.h.

--Bill

Attachment: streamer-preload-patch-07-23.txt
Description: Text document


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