Xref: utzoo comp.arch:4805 comp.lang.fortran:659 comp.software-eng:556 Path: utzoo!attcan!uunet!portal!cup.portal.com!Paul_L_Schauble From: Paul_L_Schauble@cup.portal.com Newsgroups: comp.arch,comp.lang.fortran,comp.software-eng Subject: Fortran follies Message-ID: <5377@cup.portal.com> Date: 13 May 88 03:25:48 GMT Organization: The Portal System (TM) Lines: 78 XPortal-User-Id: 1.1001.3295 I'm presently working on maintaining a Fortran compiler for a mainframe computer manufacturer. I've had a few requests lately that I'd like to throw out for opinions. Flames accepted too. The machine in question is a segmented architecture. Each segment has its own size and read/write permissions. Unfortunately, the hardware only permits 512 segments visible at one time, so they can't be used for individual arrays. The compiler has basic scalar optimization and automatic vectorizing. The first program is this program main real a(10000), b(10000) ... call sub (a, b, 10000) ... end subroutine sub (a, b, n) real a(1), b(1) <-- note dimensions do 1 i = 1,n 1 a(i) = complex expression with a(i) and b(i) .... The vectorizer looked at this and said that the maximum size of the array is 1, therefore the maximum subscript is 1 and the vector temporary needed in the subroutine only needs to be one word long. Of course, the real vector size in n. Second program is this program main ... common /one/ a(1) common /two/ space(100 000) common /tre/ alast ... c calculate sizes of sub arrays il1 = something il2 = something else il3 = yet more c calculate starting points of sub arrays ist1 = 1 ist2 = ist1 + il1 ist3 = ist2 + il2 c call working subroutine call subbr (a(ist1), a(ist2), a(ist3), il1, il2, il3) ... end subroutine subbr(x, y, z, ilx, ily, ilz) real x(1), y(1), z(1) c long calculation using x, y, z as arrays ilx, ily, and ilz long ... end It's an interesting attempt at dynamic storage allocation. This is from the CERN library, which is appearantly popular in Europe. My problem is that the compiler puts each common block in its own segment, so that all of the references to a produce segment protection faults. Now, I know that both of these are non-standard. The last not only assumes that all of common is in one segment but also assumes the order in which the common blocks are laid down in memory. The technique would work if used within a common block. But they become significant issues to me when the customer bugs my management to change the compiler to support these programs! They say that they don't want to change their code. I wonder of other compiler groups have hit these issues, and, if so, what have you decided to do about them? Is there really a significant amount of Fortran code out there that does this type of thing? Is it really possible to do Fortran on a segmented architecture machine or do prevailing coding practices rule it out? My thought is that these practices were ruled out of the standard for very good reasons. But the customer is still always right. Thanks in advance for any information, Paul_L_Schauble@cup.portal.com or sun!portal!Paul_L_Schauble ...