Array error [ moving form ifort to pgi]

Hi All,

I am tryng to compile a code I used to compile using ifort,
I compiled it with
pgf90 -c -C file.f
pgf90 -o file.x file.o
I have just a warning during the linking as

ld: warning: for symbol ctime tentative definition of size 92 from file.o is being replaced by a real definition of size 16 from /opt/pgi/osx86-64/11.5/lib/libpgf90rtl.a(ctime3f.o)

But during running I have:

Subscript out of range for array iarray (file.f: 811)
subscript=2, lower bound=1, upper bound=1, dimension=1

The program runs smooth compiling it with ifort, unlucky I can’t post the code because it is not my property
Thanks in advance

Hi g.xxcc,

Does the code run correctly without array bounds checking (-C) enabled?

  • Mat

Hi Mat,
No without the -C flag I have a “bus error” problem without any other information,
when I compile it with the intel compiler i use simply:

ifort -c file.f

without flags, maybe there are some defaults flags between the compilers that are different? For example the -C in the ifort is set by default

Thank you so much for your help :)

Hi g.xxcc,

The next step would be to debug the code to get a better idea of the problem. Compile using “pgf90 -g file.f” and run the resulting exe within the PGI debugger, i.e. “pgdbg a.out”. The debugger will abort once it hits the bus error and if it’s in user code will show you the source where the error occurs.

If you are not familiar with debuggers, please refer to the PGDBG User’s guide

  • Mat


I am having a very similar problem. I tried to debug the code manually, and what I see is weird. At some point in the code the index of the array switches from 1:n to 0:n-1. So, when it tries to access to the nth entry of the array it gives such an error.

By the way, if I run the code without array bounds checking, it doesn’t give any error, although the results I get are wrong.



I just discovered something further about the problem. The error occurs if I run the code with pgi visual fortran compiler version 11.3 on a system Intel Core2 Duo. But if I run the same code on a Intel Xeon system with pgi accelerator visual fortran version 10.9, then I don’t have that problem anymore.

ifort works the code fine in both systems.

Another update… The code works fine with PVAF version 10.9 or 11.5 regardless of the system. But with PVF version 11.4, it gives the array bound problem.

Hi Bulent,

This does seem to indicate that the problem you are encountering was a problem with the compiler and was fixed in the 11.5. In looking through the fixed 11.5 TPRs I don’t see anything about array bound issues. Though, this could be just a symptom and the real issue was fixed. It also could me that the error isn’t actually fixed, just masked.

If you can, please send a report with a reproducing example to PGI Customer Service ( I’d like them to determine what the issue is and why/if the problem has indeed been fixed.

Just in case, g.xxcc, can you please also send in a report? The two issues may or may not be related but until we investigate, there is no way know.