character pointer initialized to null() issue

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

character pointer initialized to null() issue

Mahajan, Bharat
I am seeing that gfortran crashes when compiling the following program:

===
Program Hello
character(len=:), pointer :: name => null()
allocate(character(len=7) :: name)
name = 'Prince'
Print *, "Goodbye World: ", name
End Program Hello
===

If you comment out "=>null()" then it compiles. Following is the crash
report:

===
internal compiler error: in gfc_get_symbol_decl, at
fortran/trans-decl.c:1787
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://sourceforge.net/projects/mingw-w64> for instructions.
====

Is it a known issue? I am seeing ifort can compile the above code.

My MinGW gfortran version: gcc version 8.1.0 (x86_64-posix-seh-rev0, Built
by MinGW-W64 project)


Bharat Mahajan
Reply | Threaded
Open this post in threaded view
|

Re: character pointer initialized to null() issue

Steve Kargl
On Fri, Aug 16, 2019 at 06:05:28PM -0500, Mahajan, Bharat wrote:
>
> My MinGW gfortran version: gcc version 8.1.0 (x86_64-posix-seh-rev0, Built
> by MinGW-W64 project)
>

Update to a newer vesion of gfortran.

--
Steve