diff options
author | Yvan Roux <yvan.roux@linaro.org> | 2017-05-10 11:17:30 +0200 |
---|---|---|
committer | Yvan Roux <yvan.roux@linaro.org> | 2017-05-12 11:14:09 +0000 |
commit | e09778d4678d55a9ad6aab54b48d63f3290e3214 (patch) | |
tree | 9be27010f44debb12acb859d782a8dfee49a5e68 /gcc/fortran | |
parent | a7046c549d7f29f019c1415942a6a75bdd126510 (diff) | |
download | gcc-e09778d4678d55a9ad6aab54b48d63f3290e3214.tar.gz |
Merge branches/gcc-6-branch rev 247789.
Change-Id: Ib5fcddc79d6b7cab079df944d9b5317f37821ad9
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 15 | ||||
-rw-r--r-- | gcc/fortran/class.c | 1 | ||||
-rw-r--r-- | gcc/fortran/trans-types.c | 7 |
3 files changed, 20 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 8083787f8a6..b1480052722 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,18 @@ +2017-05-01 Janus Weil <janus@gcc.gnu.org> + + Backport from trunk + PR fortran/80392 + * trans-types.c (gfc_get_derived_type): Prevent an infinite loop when + building a derived type that includes a procedure pointer component + with a polymorphic result. + +2017-04-21 Janus Weil <janus@gcc.gnu.org> + + Backport from trunk + PR fortran/80361 + * class.c (generate_finalization_wrapper): Give the finalization wrapper + the recursive attribute. + 2017-04-01 Paul Thomas <pault@gcc.gnu.org> Backport from trunk diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c index edfe59ded17..ed25276a379 100644 --- a/gcc/fortran/class.c +++ b/gcc/fortran/class.c @@ -1599,6 +1599,7 @@ generate_finalization_wrapper (gfc_symbol *derived, gfc_namespace *ns, final->attr.flavor = FL_PROCEDURE; final->attr.function = 1; final->attr.pure = 0; + final->attr.recursive = 1; final->result = final; final->ts.type = BT_INTEGER; final->ts.kind = 4; diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c index e00487526cf..98013c95be8 100644 --- a/gcc/fortran/trans-types.c +++ b/gcc/fortran/trans-types.c @@ -2610,9 +2610,10 @@ gfc_get_derived_type (gfc_symbol * derived) the same as derived, by forcing the procedure pointer component to be built as if the explicit interface does not exist. */ if (c->attr.proc_pointer - && ((c->ts.type != BT_DERIVED && c->ts.type != BT_CLASS) - || (c->ts.u.derived - && !gfc_compare_derived_types (derived, c->ts.u.derived)))) + && (c->ts.type != BT_DERIVED || (c->ts.u.derived + && !gfc_compare_derived_types (derived, c->ts.u.derived))) + && (c->ts.type != BT_CLASS || (CLASS_DATA (c)->ts.u.derived + && !gfc_compare_derived_types (derived, CLASS_DATA (c)->ts.u.derived)))) field_type = gfc_get_ppc_type (c); else if (c->attr.proc_pointer && derived->backend_decl) { |