[Bug fortran/68546] New: passing non-contiguous associated array section garbles results

klindsay at ucar dot edu gcc-bugzilla@gcc.gnu.org
Wed Nov 25 20:45:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68546

            Bug ID: 68546
           Summary: passing non-contiguous associated array section
                    garbles results
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: klindsay at ucar dot edu
  Target Milestone: ---

Created attachment 36840
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36840&action=edit
program demonstrating problem

Hi,

I've associated a non-contiguous array section to a name.
I.e. A2=>A(2,:)
When I pass A2 to a subroutine, the contents are garbled (see below).
When I compile and run the attached program, I expect the output to be

write statement with fixed i section
 201.0 202.0 203.0
----------
calling foo with fixed i section
 201.0 202.0 203.0
----------
write statement with associated fixed i section
 201.0 202.0 203.0
----------
calling foo with associated fixed i section
 201.0 202.0 203.0
----------

Instead, with gfortran v5.2.0, the last 4 lines are
----------
calling foo with associated fixed i section
 201.0 301.0 102.0
----------

If the contents of the associate construct are (A2=>A(:,2)), then the output
from the program is as I would expect it to be. So the problem seems to be
related to the non-contiguous nature of the array section. 

Could this be looked into please?

Thank you,
Keith Lindsay


More information about the Gcc-bugs mailing list