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

ICE of ifx 2024.1.0 for undefined procedure names in constructors

V-T
New Contributor I
293 Views

Consider the following minimal example:

 

program p
    interface
        function i()
        end
    end interface
    type t
        procedure(i),pointer,nopass::f
    end type
    type(t)::o
    o=t(f)  ! error #8191
end

 

The compilation of this code ends with an error `error #5633: **Internal compiler error: segmentation violation signal raised**`. This happens because an undefined procedure name `f` is used in the constructor.

If a procedure `f` is defined, but with wrong argument types like in the following code:

program p
    interface
        function i(x)result(c)
            real::x(:),c(SIZE(x))
        end function
    end interface
    type t
        procedure(i),pointer,nopass::f
    end type
    type(t)::o
    o=t(f)
contains
    function f(x)result(c)
        integer::x(:),c(SIZE(x))  ! wrong type
        c=x
    end
end

 another ICE (`error #5623`) occurs.

Labels (2)
1 Solution
Barbara_P_Intel
Moderator
203 Views

I filed a bug report on these two ICEs. Thanks for the small reproducers.

Glad you have workarounds!

We'll let you know when the fix is available.


View solution in original post

0 Kudos
1 Reply
Barbara_P_Intel
Moderator
204 Views

I filed a bug report on these two ICEs. Thanks for the small reproducers.

Glad you have workarounds!

We'll let you know when the fix is available.


0 Kudos
Reply