[net.micro.pc] Microsoft Fortran 3.3

lotto@talcott.UUCP (Jerry Lotto) (03/05/86)

A reasonably large Fortran program, compiled under Microsoft
Fortran 3.3 gave the following bug:

	parameter size=2048
	real*8 foo, bar, buzz
	dimension foo(size), bar(size), buzz(size)
	common /name/ foo, bar, buzz

do stuff

	variable = (buzz(1) - (4.0d00 * buzz(2))) / 3.0d00

do more stuff

Notice that buzz(1) is 32K (8000H) into name. The resulting code
was in-line 80x87 and read:

	FLD	es:[di][00]
	.
	.
	.
	FMUL	es:[di][8008]

The first line above is the bug... should be es:[di][8000].
The debugger confirms that es:[di] has garbage and es:[di][8000]
has the right number.
Extracting the offending line from the source to a small
subset of the original program creates different code that works
where a dual register addressing mode is used.
Also, changing to:

	common /name/ dummy, foo, bar, buzz

fixes the problem.
-- 

Gerald Lotto - Harvard Chemistry Dept.

 UUCP:  {seismo,harpo,ihnp4,linus,allegra,ut-sally}!harvard!lhasa!lotto
 ARPA:  lotto@harvard.EDU
 CSNET: lotto%harvard@csnet-relay