diff options
author | Harald Anlauf <anlauf@gmx.de> | 2024-06-18 21:57:19 +0200 |
---|---|---|
committer | Harald Anlauf <anlauf@gmx.de> | 2024-06-19 18:33:22 +0200 |
commit | 954f9011c4923b72f42cc6ca8460333e7c7aad98 (patch) | |
tree | e2eaaacf84d08030fc02eaba0762d2c09d8c7325 /gcc/fortran | |
parent | 3dfc28dbbd21b1d708aa40064380ef4c42c994d7 (diff) | |
download | gcc-954f9011c4923b72f42cc6ca8460333e7c7aad98.zip gcc-954f9011c4923b72f42cc6ca8460333e7c7aad98.tar.gz gcc-954f9011c4923b72f42cc6ca8460333e7c7aad98.tar.bz2 |
Fortran: fix for CHARACTER(len=*) dummies with bind(C) [PR115390]
gcc/fortran/ChangeLog:
PR fortran/115390
* trans-decl.cc (gfc_conv_cfi_to_gfc): Move derivation of type sizes
for character via gfc_trans_vla_type_sizes to after character length
has been set.
gcc/testsuite/ChangeLog:
PR fortran/115390
* gfortran.dg/bind_c_char_11.f90: New test.
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/trans-decl.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/fortran/trans-decl.cc b/gcc/fortran/trans-decl.cc index 8853871..f7fb6ee 100644 --- a/gcc/fortran/trans-decl.cc +++ b/gcc/fortran/trans-decl.cc @@ -7063,8 +7063,8 @@ gfc_conv_cfi_to_gfc (stmtblock_t *init, stmtblock_t *finally, if (sym->ts.type == BT_CHARACTER && !INTEGER_CST_P (sym->ts.u.cl->backend_decl)) { - gfc_conv_string_length (sym->ts.u.cl, NULL, init); - gfc_trans_vla_type_sizes (sym, init); + gfc_conv_string_length (sym->ts.u.cl, NULL, &block); + gfc_trans_vla_type_sizes (sym, &block); } /* gfc->data = cfi->base_addr - or for scalars: gfc = cfi->base_addr. |