From: vehre Date: Sun, 5 Feb 2017 13:05:10 +0000 (+0000) Subject: gcc/fortran/ChangeLog: X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f991680c6d8434786153f21a1c4e2a248fa036f1;p=thirdparty%2Fgcc.git gcc/fortran/ChangeLog: 2017-02-05 Andre Vehreschild PR fortran/79335 * trans-decl.c (generate_coarray_sym_init): Retrieve the symbol's attributes before using them. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245193 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 601017dbfdd4..222e91f15bb9 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2017-02-05 Andre Vehreschild + + PR fortran/79335 + * trans-decl.c (generate_coarray_sym_init): Retrieve the symbol's + attributes before using them. + 2017-02-05 Andre Vehreschild PR fortran/78958 diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 3e54e80a69a3..41b36a594952 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -5128,6 +5128,16 @@ generate_coarray_sym_init (gfc_symbol *sym) else reg_type = GFC_CAF_COARRAY_STATIC; + /* Compile the symbol attribute. */ + if (sym->ts.type == BT_CLASS) + { + attr = CLASS_DATA (sym)->attr; + /* The pointer attribute is always set on classes, overwrite it with the + class_pointer attribute, which denotes the pointer for classes. */ + attr.pointer = attr.class_pointer; + } + else + attr = sym->attr; gfc_init_se (&se, NULL); desc = gfc_conv_scalar_to_descriptor (&se, decl, attr); gfc_add_block_to_block (&caf_init_block, &se.pre);