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

ifx 2024.0.2 runtime error about non-contiguous target

Jorn
Novice
689 Views

Hello,

When using ifx together with -check all, I get runtime errors of the type "A pointer with the CONTIGUOUS attributes is being made to a non-contiguous target"  that I believe to be incorrect. I can reproduce the behaviour with the example below:

program test
   type typ
      real, contiguous, pointer :: p(:) => null()
   end type
   type (typ) :: a
   real, contiguous, pointer :: b(:)
   !a%p => null()
   b => a%p
end program

Compiling and runnig this with

ifx -check all ifx_contiguous.F90
./a.out

Results in:

forrtl: severe (408): fort: (32): A pointer with the CONTIGUOUS attributes is being made to a non-contiguous target.

Image              PC                Routine            Line        Source
a.out              000000000048B71E  Unknown               Unknown  Unknown
a.out              000000000040B589  Unknown               Unknown  Unknown
libc-2.31.so       00007F7BD0F01083  __libc_start_main     Unknown  Unknown
a.out              000000000040B45E  Unknown               Unknown  Unknown

 If I uncomment line 7 that explicitly nullifies a%p, the program runs without issue. This could suggest that the initialization of type member p is not happening correctly.

Other compilers (classic ifort, gfortran, aocc, nvfortran) do not have any problem with the above example.

 

Jorn

5 Replies
Barbara_P_Intel
Employee
649 Views

Is there a way to validate that this reproducer is running correctly? Add a print statement maybe.

It's the -check contiguous that is causing the failure. That's imbedded in the -check all.

As a workaround compile like this: ifx -what -check all,nocontiguous jorn.f90

It completes successfully, but there's output to confirm.

 

 

 

0 Kudos
Jorn
Novice
636 Views

Our production code passes all test suites if I omit -check all altogether, or use -check all,nocontiguous,nouninit (uninit seems to have issues of its own). Thus, it looks it is the runtime check itself that is the problem. The reduced example is so simple that there is little we can confirm, except that the association status of b should be .false. at the end. For instance, with print *, associated(b). Though I'll note for that, "nouninit" is crucial as any use of "print" otherwise triggers a MemorySanitizer warning (completely unrelated to the above example - it occurs already with a program that just prints a string...)

In other words, we can work around the issue, but I do hope that this issue can be fixed in a future release, as adding -check all is generally the first thing we (and our users) do when we start debugging.

0 Kudos
Barbara_P_Intel
Employee
632 Views

There is a known issue using -check uninit. See Ron's post. That should be fixed in ifx 2024.1.0 which is planned to be available by next week.

 

 

 

0 Kudos
Barbara_P_Intel
Employee
627 Views

I filed a bug report, CMPLRLLVM-57241. We'll let you know when it's fixed.


0 Kudos
Devorah_H_Intel
Moderator
180 Views

The issue was fixed, and the fix will be available in the 2025.0 Intel Fortran Compiler release.

0 Kudos
Reply