Declaring a character length from a function inside a module results in an ICE with recent gfortran
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc-7 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Hi,
I am running into an ICE when I try to compile a Fortran module inside which the length of a character variable declared in one of the module's functions is set according to the value returned by another function of the same module. This ICE only occurs if the first function mentioned is written before the second one. Using packages from the Bionic repositories, I was able to reproduce the ICE with gfortran 6.4.0, 7.3.0, 8.0.1 and 9.0.0 but not with gfortran 4.8.5 and 5.5.0.
Please find below the terminal outputs and attached a minimal example.
Thomas
thomas@
Description: Ubuntu 18.04 LTS
Release: 18.04
thomas@
Using built-in specs.
COLLECT_
OFFLOAD_
OFFLOAD_
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-
Thread model: posix
gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)
COLLECT_
/usr/lib/
GNU Fortran (Ubuntu 7.3.0-16ubuntu3) version 7.3.0 (x86_64-linux-gnu)
compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-
ignoring nonexistent directory "/usr/local/
ignoring nonexistent directory "/usr/lib/
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/
/usr/lib/
/usr/local/include
/usr/lib/
/usr/include/
/usr/include
End of search list.
GNU Fortran2008 (Ubuntu 7.3.0-16ubuntu3) version 7.3.0 (x86_64-linux-gnu)
compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-
f951: internal compiler error: in is_illegal_
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:/