http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54822
Bug #: 54822 Summary: OpenMP - Firstprivate optional dummy arguments crash if not present Classification: Unclassified Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassig...@gcc.gnu.org ReportedBy: roger.fer...@bsc.es The following program SUBROUTINE S(X) IMPLICIT NONE INTEGER, OPTIONAL :: X !$OMP TASK FIRSTPRIVATE(X) IF (PRESENT(X)) THEN X = X + 1 END IF !$OMP END TASK END SUBROUTINE S PROGRAM MAIN IMPLICIT NONE INTERFACE SUBROUTINE S(X) IMPLICIT NONE INTEGER, OPTIONAL :: X END SUBROUTINE S END INTERFACE CALL S() END PROGRAM MAIN crashes at runtime using gfortran 4.7.1 $ gfortran -o bug bug.f90 -fopenmp $ ./bug Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: #0 0x7FC7C9245667 #1 0x7FC7C9245C34 #2 0x7FC7C83DE4EF #3 0x4007B2 in s_._omp_cpyfn.1 at bug.f90:0 #4 0x7FC7C8DA2875 #5 0x40074D in s_ #6 0x40075D in MAIN__ at bug.f90:0 ViolaciĆ³ de segment I think that the initialization of the firstprivate X using the non-present dummy argument X is causing the crash.