Bug 41071 - cycles with TYPE_CANONICAL and TYPE_MAIN_VARIANT
Summary: cycles with TYPE_CANONICAL and TYPE_MAIN_VARIANT
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: lto (show other bugs)
Version: lto
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-14 16:55 UTC by Richard Biener
Modified: 2009-08-19 19:43 UTC (History)
1 user (show)

See Also:
Host:
Target: x86_64-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-08-19 06:14:35


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Biener 2009-08-14 16:55:36 UTC
The gimple.c patch in http://gcc.gnu.org/ml/gcc-patches/2009-08/msg00770.html
causes gcc.c-torture/execute/stdarg-1.c to endlessly recurse in get_alias_set.
Comment 1 Ben Elliston 2009-08-19 06:14:34 UTC
Confirmed.
Comment 2 Richard Biener 2009-08-19 19:40:45 UTC
Subject: Bug 41071

Author: rguenth
Date: Wed Aug 19 19:40:28 2009
New Revision: 150943

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=150943
Log:
2009-08-19  Richard Guenther  <rguenther@suse.de>

	* lto-streamer.c (lto_get_common_nodes): Skip itk_char.
	* tree.c (free_lang_data): Merge char_type_node with the
	appropriately signed variant.

	lto/
	* lto-lang.c (lto_init): Merge char_type_node with the
	appropriately signed variant.

2009-08-19  Richard Guenther  <rguenther@suse.de>

	PR lto/41071
	* gimple.c (gimple_get_alias_set): Pointers to CV qualified variants
	have the same alias-set as unqualified variants.

2009-08-19  Richard Guenther  <rguenther@suse.de>

	PR lto/41071
	* gimple.c (gimple_register_type): Unlink a pointer from its
	pointer chain if we will use a different type for it.
	* lto-streamer-out.c (lto_output_ts_type_tree_pointers):
	Do not output TYPE_POINTER_TO, TYPE_REFERENCE_TO and
	TYPE_NEXT_PTR/REF_TO.
	* lto-streamer-in.c (lto_input_ts_type_tree_pointers):
	Do not input TYPE_POINTER_TO, TYPE_REFERENCE_TO and
	TYPE_NEXT_PTR/REF_TO.

	lto/
	* lto.c (lto_fixup_common): Re-build the pointer-to chain part one.
	(lto_fixup_type): Re-build the pointer-to chain part two.

2009-08-19  Richard Guenther  <rguenther@suse.de>

	PR lto/41071
	* gimple.c (gimple_register_type): Unlink a non-main-variant from its
	variant chain if we will use a different type for it.
	* tree.c (free_lang_data_in_type): Do not free the variant chains.
	* lto-streamer-out.c (lto_output_ts_type_tree_pointers): Do
	not output TYPE_NEXT_VARIANT.
	* lto-streamer-in.c (lto_input_ts_type_tree_pointers): Do not
	input TYPE_NEXT_VARIANT.

	lto/
	* lto.c (lto_fixup_type): Re-build the type variant chain.

2009-08-19  Richard Guenther  <rguenther@suse.de>

	PR lto/41071
	* gimple.c (compare_type_names_p): Do not look at the
	types main variant.
	* lto-streamer-out.c (output_type_ref): Remove hack for char_type_node.
	* lto-streamer.c (lto_streamer_cache_insert_1):
	Remove hack for char_type_node.
	(lto_record_common_node): Canonicalize types of nodes we record.
	(lto_get_common_nodes): Record integer and size types first.
	Defer to lto_record_common_node for registering and canonicalizing
	types.

	lto/
	* lto.c (lto_fixup_constructor): New function.
	(lto_fixup_tree): Replace all types.  Properly fixup
	constructors and constants.

Modified:
    branches/lto/gcc/ChangeLog.lto
    branches/lto/gcc/gimple.c
    branches/lto/gcc/lto-streamer-in.c
    branches/lto/gcc/lto-streamer-out.c
    branches/lto/gcc/lto-streamer.c
    branches/lto/gcc/lto/ChangeLog
    branches/lto/gcc/lto/lto-lang.c
    branches/lto/gcc/lto/lto.c
    branches/lto/gcc/tree.c

Comment 3 Richard Biener 2009-08-19 19:43:40 UTC
Fixed.