aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-types.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2018-07-02 08:00:47 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2018-07-02 08:00:47 +0000
commit5d4e9f7beed5ad5808cabc615b00316bd9dfe92c (patch)
tree007ed456037b647162a8ef62fa7c17f6b4d1bc5d /gcc/fortran/trans-types.c
parente057d3e550139ae931013ca65d7bc521d8eb63c3 (diff)
downloadgcc-5d4e9f7beed5ad5808cabc615b00316bd9dfe92c.zip
gcc-5d4e9f7beed5ad5808cabc615b00316bd9dfe92c.tar.gz
gcc-5d4e9f7beed5ad5808cabc615b00316bd9dfe92c.tar.bz2
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
Diffstat (limited to 'gcc/fortran/trans-types.c')
-rw-r--r--gcc/fortran/trans-types.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index f50eb0a..5b39623 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -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);