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

Issue with the associate construct and a constructor

Jeremie_V_
Beginner
349 Views

Dear,

 

With ifort 2021.4.0 (and not with ifort 2017), I got a seg fault with the following code, when initializing a DT defined using the associate construct, and through a constructor:

 

```fortran

...

associate(parvar=>sparse%pardisovar)

 ...some code...

 parvar=pardiso_variable(maxfct=1,mnum=1,mtype=-2,solver=0,msglvl=1) !seg fault on this line
 !solution for ifort 2021.4
 ! sparse%pardisovar=pardiso_variable(maxfct=1,mnum=1,mtype=-2,solver=0,msglvl=1) !no problem with this line

 ...some code...

end associate

...

```

with `pardiso_variable` defined in another module as follows:

```fortran

...

type::pardiso_variable
!Default Pardiso variables
integer(kind=int32)::idum(1)
real(kind=wp)::ddum(1)
integer(kind=int32)::maxfct
integer(kind=int32)::mnum
integer(kind=int32)::mtype
integer(kind=int32)::msglvl
integer(kind=int32)::phase
integer(kind=int32)::solver
integer(kind=int32),allocatable::iparm(:)
type(MKL_PARDISO_HANDLE),allocatable::pt(:)
contains
final::reset_pardiso_variable
end type

interface pardiso_variable
module procedure constructor_pardiso_variable
end interface

...

contains

...some code...

```

Do I miss something? Or is it an issue with the compiler?

 

In advance thank you for your answer.

0 Kudos
0 Replies
Reply