Commit 5d4e9f7b by Richard Biener Committed by Richard Biener

re PR lto/86321 (ICE: in splice_child_die, at dwarf2out.c:5693 for several…

re PR lto/86321 (ICE:  in splice_child_die, at dwarf2out.c:5693 for several Fortran tests with -g -flto)

2018-07-02  Richard Biener  <rguenther@suse.de>

	PR lto/86321
	* trans-types.c (gfc_get_array_type_bounds): Unshare TYPE_FIELDs
	for the distinct type copy.

From-SVN: r262301
parent e057d3e5
2018-07-02 Richard Biener <rguenther@suse.de>
PR lto/86321
* trans-types.c (gfc_get_array_type_bounds): Unshare TYPE_FIELDs
for the distinct type copy.
2018-07-02 Paul Thomas <pault@gcc.gnu.org>
PR fortran/82969
......
......@@ -1923,6 +1923,14 @@ gfc_get_array_type_bounds (tree etype, int dimen, int codimen, tree * lbound,
base_type = gfc_get_array_descriptor_base (dimen, codimen, restricted);
fat_type = build_distinct_type_copy (base_type);
/* Unshare TYPE_FIELDs. */
for (tree *tp = &TYPE_FIELDS (fat_type); *tp; tp = &DECL_CHAIN (*tp))
{
tree next = DECL_CHAIN (*tp);
*tp = copy_node (*tp);
DECL_CONTEXT (*tp) = fat_type;
DECL_CHAIN (*tp) = next;
}
/* Make sure that nontarget and target array type have the same canonical
type (and same stub decl for debug info). */
base_type = gfc_get_array_descriptor_base (dimen, codimen, false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment