[14974] in Athena Bugs

home help back first fref pref prev next nref lref last post

sgi 8.0J: f77 on SGI

daemon@ATHENA.MIT.EDU (solovyov@MIT.EDU)
Thu Feb 27 14:57:20 1997

From: solovyov@MIT.EDU
To: bugs@MIT.EDU
Date: Thu, 27 Feb 1997 14:57:16 EST

System name:		carbon
Type and version:	IP22 8.0J
Display type:		NG1

What were you trying to do?
Compile and run some Fortran code (no external libraries etc.)

What's wrong:
All variables in Fortran are local, thus a variable not defined
in a subroutine can not be changed inside this subroutine unless
it is its parameter or a part of some COMMON block defined in it.
However this consistently (100% of the time) happens with my code
compiled with SGI f77 compiler (it does not happen with the same
code on Sun, IBM RISC/6000 or PC): some variable locally defined
in a procedure and nowhere else is consistently affected by the
change of another local variable in another procedure not connected
with the first variable by any means (parameters or Common blocks).
It does not matter if I change its name or description.
Example follows:

	subroutine A (x1,x2,x3)
	integer N,NQ
	real*8 T, H, Y(20)
	...
	NQ = 1
	...
	NQ = NQ+1
	...
	call B (N,T,Y)
	...
	end


	subroutine B (N,T,Y)
	real*8  S, T, Y(N)
	...
	S = (T-TOUT) / H            -- This operator changes NQ in A !
	...
	return
	end


What should have happened:
Of course, this should have never happened, but it always happens.
Tracing NQ with dbx gives consecutive values: 1,2,3,4,-1072653471
(for example), with the last change occurring in B !!!

I suspect that something is wrong with internal variable tables of
f77 compiler for SGI.  As you can imagine this bug leads to recurrent
code crashes due to segmentation voilations or bus errors.

Please describe any relevant documentation references:
none I am aware of.


I use SGI for my research work and would really like to do something
useful with it rather than observing compiler bugs.
Thank you.

Stanislav Solovyov, Ph.D.
Research Associate
Polymer Processing Research Lab
MIT Room 13-5158
77 Massachusetts Ave.
Cambridge, MA 02139

Phone: (617) 253-3046, 253-5036
Fax  : (617) 258-7874
Email: solovyov@mit.edu

home help back first fref pref prev next nref lref last post