[Bug fortran/92123] [F2018/array-descriptor] Scalar allocatable/pointer with array descriptor (via bind(C)): ICE with select rank or error scalar variable with POINTER or ALLOCATABLE in procedure with BIND(C) is not yet supported
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Nov 12 10:37:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92123
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I don't see any conversion function to be called:
fsub (struct array15_integer(kind=4) & restrict dat)
{
{
integer(kind=4) * __tmp_INTEGER_4_rank_0;
{
signed char D.3928;
integer(kind=8) D.3929;
signed char D.3930;
D.3928 = dat->dtype.rank;
D.3929 = (integer(kind=8)) D.3928 + -1;
D.3930 = D.3928 != 0 ? dat->dim[D.3929].ubound != -1 ? D.3928 : -1 :
D.3928;
if (D.3930 == 0)
{
try
{
__tmp_INTEGER_4_rank_0 = (integer(kind=4) *) dat->data;
if (__tmp_INTEGER_4_rank_0 != 0B)
{
_gfortran_runtime_error_at (&"At line 15 of file
/home/jakub/src/gcc/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_15.f90"[1]{lb:
1 sz: 1}, &"Attempting to allocate already allocated variable \'%s\'"[1]{lb: 1
sz: 1}, &"__tmp_INTEGER_4_rank_0"[1]{lb: 1 sz: 1});
}
else
{
__tmp_INTEGER_4_rank_0 = (integer(kind=4) *) __builtin_malloc
(4);
if (__tmp_INTEGER_4_rank_0 == 0B)
{
_gfortran_os_error_at (&"In file
\'/home/jakub/src/gcc/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_15.f90\',
around line 16"[1]{lb: 1 sz: 1}, &"Error allocating %lu bytes"[1]{lb: 1 sz: 1},
4);
}
}
if (__tmp_INTEGER_4_rank_0 != 0B) goto L.4;
__tmp_INTEGER_4_rank_0 = (integer(kind=4) *) __builtin_malloc
(4);
L.4:;
*__tmp_INTEGER_4_rank_0 = 42;
L.3:;
}
finally
{
dat->data = (void * restrict) __tmp_INTEGER_4_rank_0;
}
goto L.2;
}
}
L.2:;
L.1:;
return;
}
}
More information about the Gcc-bugs
mailing list