Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Fortran Automatic Arrays Error

 

Fortran Automatic Arrays Error

HP Fortran IA64 gives a run-time -F-InsVirMem error when an automatic array in a subroutine with an entry point is compiled with non-zero optimization.

Program TestAu
NN = 512
Call SubA( NN )
End

Subroutine SubA( NN )
Real Au( NN ) ! ## Automatic
type *, 'SubA NN=', NN

Entry EntA( NN, xx )
Au(NN) = NN
Return
End

When compiled on IA64 with /NoOPT, this works fine. With /Opt=Lev=1, it fails. It also works fine on AXP even with optimization. Adding or deleting lines can also cause or eliminate the failure.

Specifics: OpenVMS V8.3 IA64,
Fortran V8.1-104922,
Linker I02-31

Can anyone advise whether this error persists
in Fortran 8.2 or 8.3 ? Does anyone know when
8.4 can be expected ? HP recently cancelled access to all software patches for Campus Software Licensing Grant customers, leaving major upgrades to handle fixes.

Thanks,
C. Fred Driscoll, UCSD Physics
9 REPLIES 9
Jess Goodman
Esteemed Contributor

Re: Fortran Automatic Arrays Error

On my IA64 HP Fortran V8.2-104939-50H96 compiler running under VMS 8.4 I also get a %FOR-F-INSVIRMEM error unless I compile it with /NOOPT, and even with /NOOPT I get the error when /FLOAT=VAX_G is used.
I have one, but it's personal.
John McL
Trusted Contributor

Re: Fortran Automatic Arrays Error

Does it make a difference if you have a call to EntA (NN,xx) in the main code? I suspect that the problem lies in the optimizing of the calling structure for EntA.

The machine code listing might be helpful to see exactly what's going on.

Re: Fortran Automatic Arrays Error

John,

The run-time failure comes & goes with minor changes to the code. For example, removing the type*'SubA NN=' statement eliminates the error. Adding a separate call to EntA did not eliminate the error.

The listings with Macro for these three cases are at http://NNP.ucsd.edu/Xfer/. With 900 lines, it's pretty formidable.

Is there any way to forward this error to the HP Fortran team for their consideration? I do not have a service contract.

Fred
John Gillings
Honored Contributor

Re: Fortran Automatic Arrays Error

Fred,

> Is there any way to forward this error to
> the HP Fortran team for their
> consideration?

Not through this forum. If you're lucky, an engineer might see it and take it on, but HP does not encourage or goal engineers on particpation in ITRC.

> I do not have a service contract.

One of the things you pay for in a service contract is the right to report errors (or rather the right to have someone read your report).

On the other hand, you've produced what looks like a very succinct problem report and reproducer, so perhaps another customer with a service contract will log it for you. (Sorry, I don't have a contract which includes Fortran).

> HP recently cancelled access

I wonder what whoever made that decision was thinking?! I can't imagine it saves any money, and without the hearts and minds of educational institutions how do they expect to get new generations of customers?

Imagine if Digital had made Bliss compiler licenses free to universities back in 1978.

Would anyone have voluntarily chosen to code in C if it wasn't free?
A crucible of informative mistakes
P Muralidhar Kini
Honored Contributor

Re: Fortran Automatic Arrays Error

Hi Charles,

>> Is there any way to forward this error to the HP Fortran team for their
>> consideration? I do not have a service contract.
You can route your query to HP via the Office of OpenVMS programs.
The email id is - OpenVMS.Programs@hp.com.

Regards,
Murali
Let There Be Rock - AC/DC
Eberhard Heuser
Frequent Advisor

Re: Fortran Automatic Arrays Error

Your code is illegal.

It is not allowed to define a array in the way you want.

The array Au must be a parameter in your subroutine SubA

Subroutine SubA(Au,NN)
...

eberhard
Highlighted

Re: Fortran Automatic Arrays Error

Eberhard,

Your comments seem to apply to standard pased-address arrays.

I am coding for an "automatic array", which the HP Fortran LRM Sec 5.1.5.1 defines as an

"explicit-shape array that is a local
variable. Automatic arrays are only allowed in function and subroutine subprograms, and are declared in the specification part
of the subprogram. At least one bound of an automatic array must be a nonconstant specification expression. The bounds are
determined when the subprogram is called"

I have been using them extensively as an alternative to explicitly requesting virtual memory and then passing the address to a subroutine. If I'm mis-interpreting or over-extending the Fortran rules, please explain how.

Fred
Eberhard Heuser
Frequent Advisor

Re: Fortran Automatic Arrays Error

Fred,

Now I understand!

This is an extention of f77.

Eberhard

Re: Fortran Automatic Arrays Error

Eberhard,

Yes, I'm a die-hard F77 programmer also.

I must say, though that the local, "automatic arrays" are a _very_ useful part of F95. If they get buggy, I've got a lot of code to rework.

Fred