Skip to content

Incorrect array strides of sliced array passed as a Fortran argument #73

@sbrdar

Description

@sbrdar

What happened?

On the nvfortran 22.11 the compiler repacks sliced arrays passed as arguments to a contiguous temporary array. This return wrong strides of the sliced array.

What are the steps to reproduce the bug?

On nvfortran 22.11 (and possibly other NVHPC compilers since they repack array by default) the following fckit strides computation is incorrect:

use fckit_array_module, only : array_strides
integer(c_int) :: existing_data(8, 2, 3, 4)
print *, array_strides( existing_data(1, :, 2, :)) )

This returns [1, 2] instead of expected [8, 48].

If the flag -Mnotarget_temps is passed, the nvfortran compiler will not repack the temporaries and then we get the correct results.

Version

develop

Platform (OS and architecture)

nvfortran 22.11

Relevant log output

Accompanying data

No response

Organisation

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions