no automatic deallocation with -g -openmp

no automatic deallocation with -g -openmp

In attachment, you will find a short program demonstrating the problem.

A private allocatable array is created when calling a subroutine. The array is passed as argument with the attributes ALLOCATABLE and INTENT(out). It means that the array is first automatically deallocated at the entrance of the subroutine if it is already allocated.

For the sequential version, all seems OK, with or without the flag -g :

coul@b10p5001:~/test$ ifort demo.f90
coul@b10p5001:~/test$ ./a.out
   1.00000000000000     
   2.00000000000000     
   3.00000000000000     
   4.00000000000000     
   5.00000000000000

But with the compilation flags -g -openmp, I get :

coul@b10p5001:~/test$ ifort -g -openmp demo.f90
coul@b10p5001:~/test$ ./a.out
forrtl: severe (151): allocatable array is already allocated
forrtl: severe (151): allocatable array is already allocated

Notice that all seems OK if I delete the flag -g

64 bit version :

coul@b10p5001:~/test$ ifort --version
ifort (IFORT) 13.0.0 20120731
Copyright (C) 1985-2012 Intel Corporation.  All rights reserved.

AttachmentSize
Download demo.f90430 bytes
4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I do not see the attachment. At your convenience, could you try attaching again please?

The issue occurs in conjunction with de-optimizing (to -O0) implicit with -g or explicitly with -O1 or -O0. You can avoid the error by explicitly asserting -O2 when using -g. I reported this defect to Development (internal tracking id below) and will update the thread as I learn more. Thank you for the convenient reproducer also.

(Internal tracking id: DPD200237628)

(Resolution Update on 04/05/2013): This defect is fixed in the Intel Fortran Composer XE 2013 Update 3 (2013.3.163 - Linux)

This defect is fixed in the Intel Fortran Composer XE 2013 Update 3 (2013.3.163 - Linux)

Leave a Comment

Please sign in to add a comment. Not a member? Join today