diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2019-03-09 19:21:24 +0000 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2019-03-09 19:21:24 +0000 |
commit | 4ea60a393eee13a0a7715b7c8134e2115195c7f7 (patch) | |
tree | 39dbc71728cc53f1784eefc084ab8babbe7b8f94 /gcc/fortran | |
parent | e6780631b13612b88b1ada69ca2e736f8a16da87 (diff) | |
download | gcc-4ea60a393eee13a0a7715b7c8134e2115195c7f7.zip gcc-4ea60a393eee13a0a7715b7c8134e2115195c7f7.tar.gz gcc-4ea60a393eee13a0a7715b7c8134e2115195c7f7.tar.bz2 |
re PR fortran/71544 (gfortran compiler optimization bug when dealing with c-style pointers)
2019-03-09 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/71544
* trans-types.c (gfc_typenode_for_spec) Set ts->is_c_interop of
C_PTR and C_FUNPTR.
(create_fn_spec): Mark argument as escaping if ts->is_c_interop is set.
2019-03-09 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/71544
* gfortran.dg/c_ptr_tests_19.f90: New test.
From-SVN: r269532
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/trans-types.c | 6 |
2 files changed, 11 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 40b3a32..785c731 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2019-03-09 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR fortran/71544 + * trans-types.c (gfc_typenode_for_spec) Set ts->is_c_interop of + C_PTR and C_FUNPTR. + (create_fn_spec): Mark argument as escaping if ts->is_c_interop is set. + 2019-03-09 Janus Weil <janus@gcc.gnu.org> PR fortran/84504 diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c index 58102ba..9ae516b 100644 --- a/gcc/fortran/trans-types.c +++ b/gcc/fortran/trans-types.c @@ -1176,7 +1176,8 @@ gfc_typenode_for_spec (gfc_typespec * spec, int codim) { spec->type = BT_INTEGER; spec->kind = gfc_index_integer_kind; - spec->f90_type = BT_VOID; + spec->f90_type = BT_VOID; + spec->is_c_interop = 1; /* Mark as escaping later. */ } break; case BT_VOID: @@ -2957,7 +2958,8 @@ create_fn_spec (gfc_symbol *sym, tree fntype) || f->sym->ts.u.derived->attr.pointer_comp)) || (f->sym->ts.type == BT_CLASS && (CLASS_DATA (f->sym)->ts.u.derived->attr.proc_pointer_comp - || CLASS_DATA (f->sym)->ts.u.derived->attr.pointer_comp))) + || CLASS_DATA (f->sym)->ts.u.derived->attr.pointer_comp)) + || (f->sym->ts.type == BT_INTEGER && f->sym->ts.is_c_interop)) spec[spec_len++] = '.'; else if (f->sym->attr.intent == INTENT_IN) spec[spec_len++] = 'r'; |