backport: re PR lto/54312 (uniquify_nodes takes 12% of Mozilla LTO build)

2012-09-20  Richard Guenther  <rguenther@suse.de>

	Backport from mainline
	2012-09-11  Jan Hubicka  <jh@suse.cz>

	PR lto/54312
	* lto.c (uniquify_nodes): Remove quadratic loop checking if the
	type is variant leader.

From-SVN: r191568
This commit is contained in:
Richard Guenther 2012-09-20 14:51:59 +00:00 committed by Richard Biener
parent f31c9edcb8
commit 07df2b041e
2 changed files with 12 additions and 3 deletions

View File

@ -1,3 +1,12 @@
2012-09-20 Richard Guenther <rguenther@suse.de>
Backport from mainline
2012-09-11 Jan Hubicka <jh@suse.cz>
PR lto/54312
* lto.c (uniquify_nodes): Remove quadratic loop checking if the
type is variant leader.
2012-09-20 Release Manager
* GCC 4.7.2 released.

View File

@ -761,6 +761,7 @@ uniquify_nodes (struct data_in *data_in, unsigned from)
variant list state before fixup is broken. */
tree tem, mv;
#ifdef ENABLE_CHECKING
/* Remove us from our main variant list if we are not the
variant leader. */
if (TYPE_MAIN_VARIANT (t) != t)
@ -768,10 +769,9 @@ uniquify_nodes (struct data_in *data_in, unsigned from)
tem = TYPE_MAIN_VARIANT (t);
while (tem && TYPE_NEXT_VARIANT (tem) != t)
tem = TYPE_NEXT_VARIANT (tem);
if (tem)
TYPE_NEXT_VARIANT (tem) = TYPE_NEXT_VARIANT (t);
TYPE_NEXT_VARIANT (t) = NULL_TREE;
gcc_assert (!tem && !TYPE_NEXT_VARIANT (t));
}
#endif
/* Query our new main variant. */
mv = GIMPLE_REGISTER_TYPE (TYPE_MAIN_VARIANT (t));