[Bug fortran/71729] -Wl,-z,noexecstack Segmentation fault

2016-07-01 Thread elhombrefr at yahoo dot fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71729

--- Comment #2 from Pierre Navaro  ---
(In reply to Jakub Jelinek from comment #1)
> Don't do it then.  -z noexecstack asserts there are no trampolines in the
> code, but your code does need trampolines and thus executable stack, because
> you are passing address of a nested (contained) subroutine/function to
> another and not optimizing, so it is not inlined.

It means i have to submit the bug to mpich developers that add this flag in the
alias mpif90 ?

[Bug fortran/71729] New: -Wl,-z,noexecstack Segmentation fault

2016-07-01 Thread elhombrefr at yahoo dot fr
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.

Unfortunately this flag is present in MPICH alias mpif90.

I get the bug on fedora 24 with gcc version 6.1.1 20160621