https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71729
Bug ID: 71729 Summary: -Wl,-z,noexecstack Segmentation fault Product: gcc Version: 6.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: elhombrefr at yahoo dot fr Target Milestone: --- Created attachment 38812 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38812&action=edit Code example By compiling and running the attached fortran code prof.f90 You get this error $ gfortran -Wl,-z,noexecstack prog.f90 ; ./a.out Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: #0 0x7f5d7e300e3a #1 0x7f5d7e30002d #2 0x7f5d7d7f676f #3 0x7ffd879cf620 Segmentation fault (core dumped) without any flag you get gfortran prog.f90 $ ./a.out 1.0000000000000000 Unfortunately this flag is present in MPICH alias mpif90. I get the bug on fedora 24 with gcc version 6.1.1 20160621