https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79484
Bug ID: 79484 Summary: Segfault when executing a test in Power8 Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: sergi.mateo at bsc dot es Target Milestone: --- Created attachment 40723 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40723&action=edit test Hi, I'm getting a segfault every time that I execute a simple testcase (attached to this ticket) compiled and linked with gfortran in a Power8 machine. The same test, compiled and linked also with gfortran, runs fine in x86_64 architectures. I also detected that changing the optimizations flags from -O0 to -O2 makes it work. These are the versions of gfortran I tested (none of them worked when compiling with -O0): * GNU Fortran (GCC) 4.9.3 * GNU Fortran (GCC) 5.1.0 * GNU Fortran (GCC) 7.0.1 20170209 (experimental) About the test: what I'm doing is capturing the addresses of some variables in a derived type variable and calling a Fortran subroutine with this derived type variable as an argument (among others). This Fortran subroutine calls to a C function, passing all the addresses captured in the derived type variable and also a pointer to a Fortran subroutine as arguments (note that everything is passed by value). Finally, this C function calls to the function passed as an argument with all the other parameters as arguments. About the crash: I have been debugging this application for a while and I detected that some variables are corrupted as soon as we enter to the last Fortran function (the one that it's called from a C function). Thanks, Sergi Mateo