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

OpenMP and bounds checking on allocatable array components of derived types

ndd21
Novice
485 Views

Hello, I've just encountered this problem in a Fortran+OpenMP program:

 

laptop3:~> cat t.f90
PROGRAM t
IMPLICIT NONE
INTEGER,PARAMETER :: N=10,M=20
INTEGER :: i
TYPE pwdat_type
REAL,ALLOCATABLE :: r(:)
END TYPE pwdat_type
TYPE(pwdat_type) :: p(N)
REAL :: x(M)

DO i=1,N
ALLOCATE(p(i)%r(M))
p(i)%r=1.23
ENDDO ! i

!$OMP PARALLEL WORKSHARE DEFAULT(none) SHARED(x,p)
x=p(1)%r
!$OMP END PARALLEL WORKSHARE

END PROGRAM t
laptop3:~> ifort --version
ifort (IFORT) 2021.9.0 20230302
Copyright (C) 1985-2023 Intel Corporation. All rights reserved.

laptop3:~> ifort -O0 -check bounds -qopenmp t.f90
At least one variable in the private list was not emitted
beblk_t OMP (0x7f5778613c10)
======================================================
shared_list:
(* emitted *) "t_$P$1_V$3f"
(* emitted *) "t_$X_V$3e"
======================================================
private_list:
"var$48_V$6b"
======================================================
t.f90(16): catastrophic error: **Internal compiler error: internal abort** Please report this error along with the circumstances in which it occurred in a Software Problem Report. Note: File and line given may not be explicit cause of this error.
compilation aborted for t.f90 (code 1)

4 Replies
Barbara_P_Intel
Moderator
453 Views

Thanks for reporting this with a good reproducer. I filed a bug against ifort, CMPLRIL0-35333. That's an unusual error message before the ICE message.

As a workaround, the reproducer compiles fine with ifx. .o and .mod files are interchangeable between ifort and ifx unless you use -ipo. Have you seen the Porting Guide for Intel Fortran Compiler?

 

0 Kudos
ndd21
Novice
444 Views
0 Kudos
Barbara_P_Intel
Moderator
290 Views

@ndd21, the Internal Compiler Error (ICE) you reported is fixed in the version of ifort that was released earlier this week.

Please check it out!

 

 

0 Kudos
ndd21
Novice
264 Views

That works - thanks very much!

0 Kudos
Reply