gfortran segfault on continuation at end of program followed by two or more newlines
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc |
Confirmed
|
Medium
|
|||
gcc-5 (Ubuntu) |
Incomplete
|
Undecided
|
Unassigned | ||
gcc-6 (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
gcc-7 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
If you end a FORTRAN program with the continuation character '&' followed by two newlines, gfortran SEGFAULTs when attempting to compile the program.
This issue has a very minimal repro:
file: test.f90
```
end program &
```
The two newlines at the end are significant. The problem does not repro with 1 or 0 newlines, though it does repro with more newlines. The problem also repros when any of the lines following the continuation contain a comment. The problem repros with both LF and CRLF line endings.
I believe this program should compile without error.
Putting a token anywhere after the continuation, even separated by 2 or more newlines, results in the expected error messages.
I'm running this on Windows Subsystem for Linux, though it's not likely that is causing this bug.
The SEGFAULT error encountered:
```
andre@ANDREW-
f951: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:/
```
gfortran --version
```
andre@ANDREW-
GNU Fortran (Ubuntu 5.4.0-6ubuntu1~
Copyright (C) 2015 Free Software Foundation, Inc.
```
lsb_release -rd
```
andre@ANDREW-
Description: Ubuntu 16.04.3 LTS
Release: 16.04
```
apt-cache policy gfortran
```
andre@ANDREW-
gfortran:
Installed: 4:5.3.1-1ubuntu1
Candidate: 4:5.3.1-1ubuntu1
Version table:
*** 4:5.3.1-1ubuntu1 500
500 http://
100 /var/lib/
```
Changed in gcc: | |
importance: | Unknown → Medium |
status: | Unknown → Confirmed |
please recheck with 16.04 and 17.10.