This is the mail archive of the gcc-cvs@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]

r179505 - in /trunk/gcc/lto: ChangeLog lto-obje...


Author: ak
Date: Tue Oct  4 14:12:37 2011
New Revision: 179505

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179505
Log:
Maintain order of LTO sections

Currently when reading in LTO sections from ld -r files they can
get randomly reordered based on hash tables and random IDs.
This causes reordering later when the final code is generated and
also makes crashes harder to reproduce.

This patch maintains explicit lists based on the input order and uses
those lists to preserve that order when starting the rest of the
LTO passes.

This is the first step to working -fno-toplevel-reorder for
LTO. But this needs more changes because the LTO partitioner
can still reorder.

This add two lists: one for the section and another one for
the file_decl_datas. This is needed because the sections are
walked twice through different data structures.

In addition some code becomes slightly cleaner because we don't need
to pass state through abstract callbacks anymore, but
can just use direct type safe calls.

gcc/lto/:

2011-10-02   Andi Kleen <ak@linux.intel.com>

	* lto-object.c (lto_obj_add_section_data): Add list.
	(lto_obj_add_section): Fill in list.
	(ltoobj_build_section_table): Pass through list.
	* lto.c (file_data_list): Declare.
	(create_subid_section_table): Pass arguments directly.
	Fill in list of file_datas.
	(lwstate): Delete.
	(lto_create_files_from_ids): Pass in direct arguments.
	Don't maintain list.
	(lto_file_read): Use explicit section and file data lists.
	(lto_read_all_file_options): Pass in section_list.
	* lto.h (lto_obj_build_section_table): Add list.
	(lto_section_slot): Add next.
	(lto_section_list): Declare.

Modified:
    trunk/gcc/lto/ChangeLog
    trunk/gcc/lto/lto-object.c
    trunk/gcc/lto/lto.c
    trunk/gcc/lto/lto.h


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