[Bug fortran/87838] Segmentation fault with function pointer to contained function
menospaamthereaper at hotmail dot com
gcc-bugzilla@gcc.gnu.org
Sun Nov 4 04:01:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87838
--- Comment #2 from menospaamthereaper at hotmail dot com ---
Thank you Dominique for testing this on a Mac. So perhaps the problem is
specific to Linux.
Additional information that might help with debugging the segmentation fault:
1) Compiling this code with
gfortran -ffree-form -std=f2003 test.f
gives the error
test.f:12:13:
f_ptr => f1
1
Error: Fortran 2008: Internal procedure ‘f1’ is invalid in procedure pointer
assignment at (1)
(this code is within gcc/fortran/expr.c:
if (attr.proc == PROC_INTERNAL &&
!gfc_notify_std(GFC_STD_F2008, "Internal procedure %qs "
"is invalid in procedure pointer assignment "
"at %L", rvalue->symtree->name, &rvalue->where))
)
2) However,
gfortran -ffree-form -std=f2008 test.f
compiles successfully but gives a segmentation fault.
./a.out
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
Backtrace for this error:
#0 0x7fe7aae3b31a
#1 0x7fe7aae3a503
#2 0x7fe7aaa5ef1f
#3 0x7fffed8fe6c0
Segmentation fault (core dumped)
More information about the Gcc-bugs
mailing list