Quantcast
Channel: Intel® Software - Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2746

Ifort 19.0.2 with -O2: Compilation hangs when allocating Array to 0-size

$
0
0

I am using the newest Ifort compiler and the compilation hangs (running forever) when I compile with -O2. I could narrow it down to a few lines of code where an array is allocated to zero size. The following example demonstrates what I am doing, but compiles without any issues. The actual code (part of a bigger project) is attached. It requires some libraries and MPI to build/

program allocate_zero                                                                               
                                                                                                    
  implicit none                                                                                     
  type :: tParameters                                                                               
    real, allocatable, dimension(:,:) :: &                                                          
      gdot0_slip, &                                                                                  !< reference shear strain rate for slip
      gdot0_twin                                                                                    
  end type                                                                                          
                                                                                                    
 type(tParameters), dimension(:), allocatable :: param                                              
 integer :: i                                                                                       
                                                                                                    
 allocate(param(3))                                                                                 
                                                                                                    
 do i = 1, 3                                                                                        
 associate(p => param(i))                                                                           
   if (i > 2) then                                                                                  
    allocate(p%gdot0_slip(0,0))                                                                     
   endif                                                                                            
 end associate                                                                                      
 enddo                                                                                              
                                                                                                    
end program 

 

AttachmentSize
Downloadapplication/octet-streamplastic_phenopowerlaw.f9032.32 KB

Viewing all articles
Browse latest Browse all 2746

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>