Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

ifort segfaults during compilation

domel07
Beginner
530 Views
The following code crashes the compiler. Of course, the code has a bug, but the compiler apparently too. The compiler is Intel Fortran Compiler for applications running on Intel 64, Version 10.1 Build 20080602 Package ID: l_fc_p_10.1.017. Host is 64 bit 8xAMD on linux. Compile command:
ifort -openmp -openmp-report1 -fpp -O3 -o /tmp/BUG.o -c BUG.F90.

MODULE USER
IMPLICIT NONE

CONTAINS

SUBROUTINE TEST(UFIX)
DOUBLE PRECISION, DIMENSION(:,:), ALLOCATABLE, INTENT(INOUT) :: UFIX
INTEGER :: NFIXU
INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: PMARKER

NFIXU = COUNT(PMARKER==1 .OR. PMARKER==2 .OR. PMARKER==4)
WRITE(*,*) 'NFIXU = ', NFIXU
CALL RESIZE(UFIX,(/NFIXU,3/))
UFIX = 0D0
END SUBROUTINE

END MODULE

0 Kudos
5 Replies
Steven_L_Intel1
Employee
530 Views
I can reproduce this - I will pass it on to the developers. Thanks.

If I find a workaround, other than omitting -openmp from this source, I'll let you know.
0 Kudos
domel07
Beginner
530 Views
The problem is not the bug in the code I find but the SAVE attribute of PMARKER.
0 Kudos
TimP
Honored Contributor III
530 Views
You are correct, that the SAVE attribute would be an error if the module were USEd in a parallel region. The compiler should give a clear message to that effect, and should permit it to work in serial regions.
0 Kudos
domel07
Beginner
530 Views
This portion of the code is not called from within a parallel region in my actual program. Compiled with -openmp just as all the project files. --DS
0 Kudos
Steven_L_Intel1
Employee
530 Views
A fix for this problem is expected in the next 10.1 update, planned for late October.
0 Kudos
Reply