From: mecej4 on
I know that statement functions are considered obsolescent, but there are
some widely used high-quality subroutine libraries in which they are used.

With an older version of the NAG compiler, I found that the program

program asfbug
INTEGER IX,IY,IDIAG,A,B,C
IDIAG(IX,IY) = ((IY-1)* (2*IX-IY+2))/2
C
A=13
C=2
B=13
write(*,*)IDIAG(A-C,B-C),IDIAG((A-C),(B-C))
end

prints

75 65

instead of the expected

65 65

Would someone please try the current version of the NAG compiler on this?

Thanks.

-- mecej4
From: Terence on
This gave me 65 65 on all my compilers, none of which is NAG.
From: Michael on
On May 1, 6:53 pm, Terence <tbwri...(a)cantv.net> wrote:
> This gave me 65 65 on all my compilers, none of which is NAG.

This also gave 65 65 on all my compilers (g95, Compaq, Intel)
From: Reinhold Bader on
Hello,

NAG 5.2 (721) on x86_64 also gets this wrong


Cheers
Reinhold


Am 02.05.2010 01:07, schrieb mecej4:
> I know that statement functions are considered obsolescent, but there are
> some widely used high-quality subroutine libraries in which they are used.
>
> With an older version of the NAG compiler, I found that the program
>
> program asfbug
> INTEGER IX,IY,IDIAG,A,B,C
> IDIAG(IX,IY) = ((IY-1)* (2*IX-IY+2))/2
> C
> A=13
> C=2
> B=13
> write(*,*)IDIAG(A-C,B-C),IDIAG((A-C),(B-C))
> end
>
> prints
>
> 75 65
>
> instead of the expected
>
> 65 65
>
> Would someone please try the current version of the NAG compiler on this?
>
> Thanks.
>
> -- mecej4

From: mecej4 on
Reinhold Bader wrote:

> Hello,
>
> NAG 5.2 (721) on x86_64 also gets this wrong
>
>
> Cheers
> Reinhold
>

Thank you.

I was afraid this would be the case, since the implication is that anyone
who calls the sparse symmetric indefinite linear equations solver MA27 from
the Harwell Library should be careful if the NAG compilers are used.

The workaround (at least on the older version of NAG F95) is to enclose the
arguments with an extra set of parentheses.

-- mecej4

> Am 02.05.2010 01:07, schrieb mecej4:
>> I know that statement functions are considered obsolescent, but there are
>> some widely used high-quality subroutine libraries in which they are
>> used.
>>
>> With an older version of the NAG compiler, I found that the program
>>
>> program asfbug
>> INTEGER IX,IY,IDIAG,A,B,C
>> IDIAG(IX,IY) = ((IY-1)* (2*IX-IY+2))/2
>> C
>> A=13
>> C=2
>> B=13
>> write(*,*)IDIAG(A-C,B-C),IDIAG((A-C),(B-C))
>> end
>>
>> prints
>>
>> 75 65
>>
>> instead of the expected
>>
>> 65 65
>>
>> Would someone please try the current version of the NAG compiler on this?
>>
>> Thanks.
>>
>> -- mecej4