-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reproducer for gfortran bug 98141 #7
base: master
Are you sure you want to change the base?
Conversation
gfortran-bugs/CMakeLists.txt
Outdated
@@ -5,6 +5,7 @@ include(testing) | |||
|
|||
project(gfortran-bug Fortran) | |||
|
|||
add_compiler_test(SOURCES gfortran-20201204.f90 RUN_ONLY LABELS PR98141) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing this should be RUN_ONLY, since I expect it to compile but to segfault when run.
Looking at your example and drawing on past experience, I suspected that the problem was with the sourced allocation statement, and that does appear the case (although there may be multiple compiler bugs here). Here's a minimal example that triggers a segfault: class(*), allocatable :: a, b
allocate(character(len=0)::a)
allocate(b, source=a)
end |
Nice! Strangely, this doesn't work program foo
class(*), allocatable :: a, b
allocate(a, source='') !! No problem
allocate(b, source=a) !! Segfaults
end program I'll add these examples to the bug report. |
I'll also pare down the example in this MR and add the new examples. |
This does work, however: program foo
class(*), allocatable :: a
character(len=0) :: s
allocate(a, source=s)
end program |
This latest version has the minimal examples we found. |
This PR adds a minimal reproducer for gfortran bug 98141.