Was this a bug



I succeeded in generating code that ollks something like this:
MODULE FRED
INTEGER, ALLOCATABLE :: IARRAY(:)
END MODULE

PROGRAM


etc.etc.

USE FRED
CALL SUB ( IARRAY(7) )

etc.

END
SUBROUTINE SUB ( I )

USE FRED

(Reallocate IARRAY larger, making lower bound more negative)

IARRAY(-3) = I

RETURN

END


I tried it with two compilers, one worked OK, one corrupted IARRAY(7),
but when I stuck in a WRITE statement, it worked OK.


I can see why the program fails, but have difficulty in seeing why it
should ever work correctly.

Any comments out there ?

Is there anything in the standard making the above code illegal ?

Dave Flower

.