HP OpenVMS Systems Documentation

Content starts here

HP Fortran for OpenVMS
User Manual


Previous Contents Index

The compiler issues an error message if it encounters a CDD/Repository feature that conflicts with HP Fortran. It ignores any CDD/Repository features that it does not support.

2.6 Compiler Limits, Diagnostic Messages, and Error Conditions

The following sections discuss the compiler limits and error messages.

2.6.1 Compiler Limits

Table 2-5 lists the limits to the size and complexity of a single HP Fortran program unit and to individual statements contained in it.

The amount of data storage, the size of arrays, and the total size of executable programs are limited only by the amount of process virtual address space available, as determined by process quotas and system parameters.

Table 2-5 Compiler Limits
Language Element Limit
Actual number of arguments per CALL
or function reference
255
Arguments in a function reference
in a specification expression
255
Array dimensions 7
Array elements per dimension 9,223,372,036,854,775,807 or process limit
Constants; character and Hollerith 2000 characters
Constants; characters read in list-directed I/O 2048 characters
Continuation lines 511
DO and block IF statement nesting (combined) 128
DO loop index variable 9,223,372,036,854,775,807 or process limit
Format group nesting 8
Fortran source line length 132 characters
INCLUDE file nesting 20 levels
Labels in computed or assigned GOTO list 500
Lexical tokens per statement 3000
Parentheses nesting in expressions 40
Structure nesting 20
Symbolic-name length 63 characters

For More Information:

On relevant process quotas and system parameters, see Section 1.2.

2.6.2 Compiler Diagnostic Messages and Error Conditions

The HP Fortran compiler identifies syntax errors and violations of language rules in the source program.

If the compiler locates any errors, it writes messages to your default output device; so, if you enter the FORTRAN command interactively, the messages are displayed on your terminal. If the FORTRAN command is executed in a batch job, the messages appear in the log file for the batch job.

A sample message from the compiler as it would appear on a terminal screen follows:


   40    FORMAT (I3,)
   ................^
   %F90-W-ERROR, An extra comma appears in the format list.
   at line number 13 in file DISK$:[USER]SAMP_MESS.FOR;4

This sample message consists of the following lines:

  • The source file line that caused the message
  • A pointer (...^ on a terminal or ...1 in a listing file) to the part of the source line causing the error
  • The actual message (facility, severity, mnemonic, and text)
  • The line number and name of source file

The message line has the following format:


%F90-s-ident, message-text

The facility, F90, follows the percent sign (%). The severity of the message (I for informational, W for warning, E for error, or F for fatal) replaces s. A mnemonic for that message replaces ident. The explanatory text of the message replaces message-text.

Diagnostic messages usually provide enough information for you to determine the cause of an error and correct it. If you compile using the /OPTIMIZE qualifier (the default) and have difficulty determining the cause of an error (possibly because of the optimizations), consider compiling using a lower optimization level or /NOOPTIMIZE.

If the compiler creates a listing file, it also writes the messages to the listing. The pointer (...1) and messages follow the statement that caused the error.

2.7 Compiler Output Listing Format

A compiler output listing produced by a FORTRAN command with the /LIST qualifier consists of the following sections:

  • A source code section
  • A machine code section---optional
  • A storage map section (cross-reference)---optional
  • A compilation summary

Section 2.7.1 through Section 2.7.5 describe the compiler listing sections in detail.

For More Information:

2.7.1 Source Code Section

The source code section of a compiler output listing displays the source program as it appears in the input file, with the addition of sequential line numbers generated by the compiler. Example 2-1 and Example 2-2 show a sample of a source code section of a free-form compiler output listing.

Example 2-1 Sample Listing of Source Code on OpenVMS I64

SIMPLE$MAIN$BLK   Source Listing  26-OCT-2004 15:29:44  HP Fortran V8.0-48291      Page 1
                                  26-OCT-2004 15:29:26  DISK$DKA100:[USERNAME.BUG]SIMPLE.F90;1

       1  integer i
       2  i = 10
       3  type *,i
       4  end


PROGRAM SECTIONS

    Name                         Bytes   Attributes

  1 $LITERAL$                           24   PIC CON REL LCL   SHR NOEXE   RD NOWRT OCTA
  2 $CODE$                             224   PIC CON REL LCL   SHR   EXE NORD NOWRT OCTA
  3 $SBSS$                              12 NOPIC CON REL LCL NOSHR NOEXE   RD   WRT OCTA

    Total Space Allocated                  260


ENTRY POINTS

 Address      Name

  2-00000000  SIMPLE$MAIN


VARIABLES

 Address      Type  Name

  3-00000008  I*4   I

Example 2-2 Sample Listing of Source Code on OpenVMS Alpha


RELAX2      Source Listing  19-DEC-2004 16:12:46  HP Fortran V8.x-xxxx        Page 1
                            12-DEC-2004 10:41:04  F90$DISK:[TUCKER]LIST_EX.F90;3

       1    SUBROUTINE RELAX2(EPS)
       2      INTEGER, PARAMETER :: M=40
       3      INTEGER, PARAMETER :: N=60
       4
       5      COMMON X (M,N)
       6
       7      LOGICAL DONE
       8  10  DONE = .TRUE.
       9
      10      DO J=1,N-1
      11        DO I=1,M-1
      12          XNEW = (X(I-1,J)+X(I+1,J)+X(I,J-1)+X(I,J+1))/4
      13          IF (ABS(XNEW-X(I,J)) > EPS) DONE = .FALSE.
      14          X(I,J) = XNEW
      15        END DO
      16      END DO
      17
      18      IF (.NOT. DONE) GO TO 10
      19      RETURN
      20      END SUBROUTINE


Compiler-generated line numbers appear in the left margin and are used with the %LINE prefix in debugger commands. These compiler-generated line numbers are displayed by compiler-generated messages and certain run-time error messages. (For more information on messages, see Appendix C.)

2.7.2 Machine Code Section

The machine code section of a compiler output listing provides a symbolic representation of the compiler-generated object code. The representation of the generated code and data is similar to that of a MACRO assembly listing.

The machine code section is optional. To receive a listing file with a machine code section, you must specify the following:


$ FORTRAN/LIST/MACHINE_CODE

Example 2-3 shows a sample of part of a machine code section of a compiler output listing for OpenVMS I64 systems.

Example 2-3 Sample (Partial) Listing of Machine Code on OpenVMS I64

SIMPLE$MAIN$BLK     Machine Code Listing    26-OCT-2004 15:29:34  HP Fortran V8.0-48291             Page 2
                                            26-OCT-2004 15:29:26  DISK$DKA100:[USERNAME.BUG]SIMPLE.F90;1

          .psect $CODE$, CON, LCL, SHR, EXE, NOWRT, NOVEC, NOSHORT
          .proc   MAIN__
          .align 32
          .global  MAIN__
          .personality  DFOR$HANDLER
          .handlerdata  -32
   MAIN__:               // 000002
      { .mii
002C0081A980     0000        alloc   r38 = rspfs, 0, 8, 5, 0
0119F8C80300     0001        adds    sp = -64, sp   // r12 = -64, r12
0108001009C0     0002        mov     r39 = gp ;;   // r39 = r1
      }
      { .mib
010800C40080     0010        adds    r2 = 32, sp   // r2 = 32, r12
000188000940     0011        mov     r37 = rp    // r37 = br0
004000000000     0012        nop.b   0 ;;
      }
      { .mii
008CC0200000     0020        st8     [r2] = r0
0120001000C0     0021        add     r3 = @ltoff($LITERAL$+16), gp // r3 = @ltoff($LITERAL$+16), r1
012000002640     0022        mov     ai = 1    // r25 = 1
      }
      { .mmi
012000014880     0030        mov     r34 = 10 ;;
0080C03000C0     0031        ld8     r3 = $LITERAL$   // r3 = [r3]
000008000000     0032        nop.i   0 ;;
      }
      { .mfb
010800300A00     0040        mov     out0 = r3    // r40 = r3
000008000000     0041        nop.f   0
00A000001000     0042        br.call.sptk.many rp = DFOR$SET_FPE ;; // br0 = DFOR$SET_FPE
      }
      { .mii
010802700040     0050        mov     gp = r39    // r1 = r39
012000002640     0051        mov     ai = 1 ;;    // r25 = 1
012000100800     0052        add     r32 = @ltoff($LITERAL$+8), gp ;; // r32 = @ltoff($LITERAL$+8), r1
      }
      { .mfb
0080C2000A00     0060        ld8     out0 = $LITERAL$   // r40 = [r32]
000008000000     0061        nop.f   0
00A000001000     0062        br.call.sptk.many rp =    // br0 = DFOR$SET_REENTRANCY
           DFOR$SET_REENTRANCY ;;
      }
      { .mii
010802700040     0070        mov     gp = r39    // r1 = r39
010800C208C0     0071        adds    r35 = 16, sp   // r35 = 16, r12      // 000003
010800C40840     0072        adds    r33 = 32, sp   // r33 = 32, r12
      }
      { .mmi
01200000A640     0080        mov     ai = 5 ;;    // r25 = 5
012000100900     0081        add     r36 = @ltoffx($LITERAL$), gp // r36 = @ltoffx($LITERAL$), r1
010800C20B00     0082        adds    out4 = 16, sp   // r44 = 16, r12
      }
      { .mlx
0119F80FCA40     0090        adds    out1 = -2, r0   // r41 = -2, r0
000000000002     0091        movl    out2 = 8716160 ;;   // r42 = 8716160
019FF20015
      }
      { .mii
0080C2400AC0     00A0        ld8.mov out3 = [r36], $LITERAL$
010800C40A00     00A1        adds    out0 = 32, sp   // r40 = 32, r12
000008000000     00A2        nop.i   0 ;;
      }
      { .mmb
008C82344000     00B0        st4     [r35] = r34
008C82100000     00B1        st4     [r33] = r0
00A000001000     00B2        br.call.sptk.many rp =    // br0 = DFOR$WRITE_SEQ_LIS
           DFOR$WRITE_SEQ_LIS ;;
      }
      { .mii
012000002200     00C0        mov     r8 = 1            // 000004
010802700040     00C1        mov     gp = r39    // r1 = r39       // 000003
00015404C000     00C2        mov.i   rspfs = r38 ;;           // 000004
      }
      { .mib
010800C80300     00D0        adds    sp = 64, sp   // r12 = 64, r12
000E0014A000     00D1        mov     rp = r37    // br0 = r37
000108001100     00D2        br.ret.sptk.many rp ;;   // br0
      }
          .endp   MAIN__

Routine Size: 224 bytes,    Routine Base: $CODE$ + 0000

          .psect $SBSS$, CON, LCL, NOSHR, NOEXE, WRT, NOVEC, SHORT
          .lcomm  var$0004, 1, 1
          .lcomm  fill$$1, 11, 16

          .psect $LITERAL$, CON, LCL, SHR, NOEXE, NOWRT, NOVEC, NOSHORT
00010109         0000        string  "\X09\X01\X01\X00"

00000000         0008        data8   0x0 // data8 0
00000000         000C
00200000         0010        data8   0x200000 // data8 2097152
00000000         0014

The following list explains how generated code and data are represented in machine code listings on OpenVMS I64 systems:

  • Machine instruction bundles are marked by curly braces, and the bundle type is at the top after the open brace.
  • Machine instructions in a bundle are shown in hexadecimal on the far left. The next column to the right is the hexadecimal address offset of the instruction from the routine base address. The next column is a symbolic representation, using memnonics and symbolic operand expressions (such as "out1"). The actual operand registers are shown in comments in the next column to the right (such as "r40").
  • A predicate register controlling an instruction is shown in parentheses before the mnemonic representation.
  • Line numbers corresponding to the generated code are shown on the far right side of the listing.

Example 2-4 shows a sample of part of a machine code section of a compiler output listing for OpenVMS Alpha systems.

Example 2-4 Sample (Partial) Listing of Machine Code on OpenVMS Alpha


RELAX2       Machine Code Listing      19-DEC-2004 16:12:46 HP Fortran V8.x-xxxx          Page 3
                                       12-DEC-2004 10:41:04  F90$DISK:[TUCKER]LIST_EX.F90;3
             .PSECT $CODE$, OCTA, PIC, CON, REL, LCL, SHR,-
                  EXE, NORD, NOWRT

      0000 RELAX2::
23DEFFC0     0000  LDA SP, -64(SP)
80100000     0004  LDF F0, (R16)                 ; 000013
A41B0020     0008  LDQ R0, 32(R27)               ; 000012
B77E0000     000C  STQ R27, (SP)                 ; 000001
B75E0008     0010  STQ R26, 8(SP)
B7BE0010     0014  STQ FP, 16(SP)
9C5E0018     0018  STT F2, 24(SP)
9C7E0020     001C  STT F3, 32(SP)
9C9E0028     0020  STT F4, 40(SP)
9CBE0030     0024  STT F5, 48(SP)
9CDE0038     0028  STT F6, 56(SP)
47FE041D     002C  MOV SP, FP
803B0028     0030  LDF F1, 40(R27)               ; 000012
2FFE0000     0034  UNOP
2FFE0000     0038  UNOP
2FFE0000     003C  UNOP
      0040 .10:                                      ; 000008
2FFE0000     0040  UNOP
2FFE0000     0044  UNOP
2FFE0000     0048  UNOP
2FFE0000     004C  UNOP
203FFFFF     0050  MOV -1, DONE ; -1, R1
47E77411     0054  MOV 59, var$0002 ; 59, R17 ; 000010
47F41412     0058  MOV 160, R18                ; 000014
2FFE0000     005C  UNOP
      0060 lab$0004:                                 ; 000010
2FFE0000     0060  UNOP
2FFE0000     0064  UNOP
2FFE0000     0068  UNOP
2FFE0000     006C  UNOP
40120413     0070  ADDQ R0, R18, R19
47E4F414     0074  MOV 39, var$0003 ; 39, R20 ; 000011
2273FF5C     0078  LDA R19, -164(R19)            ; 000012
2FFE0000     007C  UNOP
      0080 lab$0008:                                 ; 000011
2FFE0000     0080  UNOP
2FFE0000     0084  UNOP
2FFE0000     0088  UNOP
2FFE0000     008C  UNOP
81530008     0090  LDF F10, 8(R19)
8193FF64     0094  LDF F12, -156(R19)
47FF0418     0098  CLR     R24                       ; 000013
81730000     009C  LDF F11, (R19)                ; 000012
81B300A4     00A0  LDF F13, 164(R19)
81D3000C     00A4  LDF F14, 12(R19)
8213FF68     00A8  LDF F16, -152(R19)
823300A8     00AC  LDF F17, 168(R19)
82730010     00B0  LDF F19, 16(R19)
82B3FF6C     00B4  LDF F21, -148(R19)
82D300AC     00B8  LDF F22, 172(R19)
82F30014     00BC  LDF F23, 20(R19)
8333FF70     00C0  LDF F25, -144(R19)
835300B0     00C4  LDF F26, 176(R19)
83730018     00C8  LDF F27, 24(R19)
.
.
.
Routine Size: 1020 bytes,    Routine Base: $CODE$ + 0000


    .PSECT $LINK$, OCTA, NOPIC, CON, REL, LCL,-
     NOSHR, NOEXE, RD, NOWRT

      0000  ; Stack-Frame invocation descriptor
    Entry point:        RELAX2
    Entry Length:          48
    Registers used:        R0-R1, R16-R25, R27-FP,
                                                       F0-F6, F10-F30
    Registers saved:       FP, F2-F6
    Fixed Stack Size:      64

00000000     0020  .ADDRESS $BLANK
00003F80     0028  .LONG X^3F80 ; .F_FLOATING 0.2500000

The following list explains how generated code and data are represented in machine code listings on OpenVMS Alpha systems:

  • Machine instructions are represented by MACRO mnemonics and syntax. To enable you to identify the machine code that is generated from a particular line of source code, the compiler-generated line numbers that appear in the source code listing are also used in the machine code listing. These numbers appear in the right margin, preceding the machine code generated from individual lines of source code.
  • The first line contains a .TITLE assembler directive, indicating the program unit from which the machine code was generated:
    • For a main program, the title is as declared in a PROGRAM statement. If you did not specify a PROGRAM statement, the main program is titled filename$MAIN, where filename is the name of the source file.
    • For a subprogram, the title is the name of the subroutine or function.
    • For a BLOCK DATA subprogram, the title is either the name declared in the BLOCK DATA statement or filename$DATA (by default).
  • The lines following .TITLE provide information such as the contents of storage initialized for FORMAT statements, DATA statements, constants, and subprogram argument call lists.
  • General registers (0 through 31) are represented by R0 through R31 and floating-point registers are represented by F0 through F31. The relative PC for each instruction or data item is listed at the left margin, in hexadecimal.
  • Variables and arrays defined in the source program are shown as they were defined in the program. Offsets from variables and arrays are shown in decimal. (Optimization frequently places variables in registers, so some names may be missing.)
  • HP Fortran source labels referenced in the source program are shown with a period prefix (.). For example, if the source program refers to label 300, the label appears in the machine code listing as .300. Labels that appear in the source program, but are not referenced or are deleted during compiler optimization, are ignored. They do not appear in the machine code listing unless you specified /NOOPTIMIZE.
  • The compiler might generate labels for its own use. These labels appear as L$n or lab$000n, where the value of n is unique for each such label in a program unit.
  • Integer constants are shown as signed integer values; real and complex constants are shown as unsigned hexadecimal values preceded by ^X.
  • Addresses are represented by the program section name plus the hexadecimal offset within that program section. Changes from one program section to another are indicated by PSECT lines.

2.7.3 Annotations Section

The annotations section of the compiler output listing describes special instructions used for optimizations such as prefetching, inlining, and loop unrolling. It is controlled by the /ANNOTATIONS qualifier. See Section 2.3.5.

Example 2-5 shows the list of annotations that is produced from the following source code:


1 2 3 4 5 6 7            287 work1=sqrt((xlatt*real(mindex,LONGreal))
                             **2+(ylatt*real(nindex,LONGreal))**2+(q-p)**2)
8 9 10 11 12             288 work2=q-p

Example 2-5 Sample (Partial) Listing of Annotations

1. Software pipelining across 4 iterations; unrolling loop 2 times;
   steady state estimated 180 cycles; 0 prefetch iterations
2. Unrolling loop 6 times
3. Prefetching MINDEX, 128 bytes ahead
4. Prefetching NINDEX, 128 bytes ahead
5. Prefetching Q, 128 bytes ahead
6. Write-hinting WORK1, distance 128
7. Prefetching P, 128 bytes ahead
8. Software pipelining across 2 iterations; unrolling loop 2 times;
   steady state estimated 17 cycles; 0 prefetch iterations
9. Prefetching P, 192 bytes ahead
10. Write-hinting WORK2, distance 128
11. Unrolling loop 7 times
12. Prefetching Q, 192 bytes ahead

2.7.4 Storage Map Section

The storage map section of the compiler output listing is printed after each program unit, or library module. It is not generated when a fatal compilation error is encountered.

The storage map section summarizes information in the following categories:

  • Program sections
    The program section summary describes each program section (PSECT) generated by the compiler. The descriptions include:
    • PSECT number (used by most of the other summaries)
    • Name
    • Size in bytes
    • Attributes

    PSECT usage and attributes are described in Section 13.1.
  • Total memory allocated
    Following the program sections, the compiler prints the total memory allocated for all program sections compiled in the following form:


    Total Space Allocated nnn
    
  • Entry points
    The entry point summary lists all entry points and their addresses. If the program unit is a function, the declared data type of the entry point is also included.
  • Variables
    The variable summary lists all simple variables, with the data type and address of each. If the variable is removed as a result of optimization, a double asterisk (**) appears in place of the address.
  • Records
    The record summary lists all record variables and derived types. It shows the address, the structure that defines the fields of the individual records or types, and the total size of each record or type.
  • Arrays
    The array summary is similar to the variable summary. In addition to data type and address, the array summary gives the total size and dimensions of the array. If the array is an adjustable array or assumed-size array, its size is shown as a double asterisk (**), and each adjustable dimension bound is shown as a single asterisk (*).
  • Record Arrays
    The record array summary is similar to the record summary. The record array summary gives the dimensions of the record or derived-type array in addition to address, defining structure, and total size. If the record or derived-type array is an adjustable array or assumed-size array, its size is shown as a double asterisk (**), and each adjustable dimension bound is shown as a single asterisk (*).
  • Labels
    The label summary lists all user-defined statement labels. FORMAT statement labels are suffixed with an apostrophe ('). If the label address field contains a double asterisk (**), the label was not used or referred to by the compiled code.
  • Functions and subroutines
    The functions and subroutines summary lists all external routine references made by the source program. This summary does not include references to routines that are dummy arguments, because the actual function or subroutine name is supplied by the calling program.

A heading for an information category is printed in the listing only when entries are generated for that category.

Example 2-6 shows an example of a storage map section.

Example 2-6 Sample Storage Map Section


RELAX2   Source Listing                  19-DEC-2004 16:12:46 HP Fortran v8.x-xxxx          Page 1
                                         12-DEC-2004 10:41:04  F90$DISK:[TUCKER]LIST_EX.F90;3
PROGRAM SECTIONS

    Name     Bytes   Attributes

  1 $CODE$                                1020   PIC CON REL LCL   SHR   EXE NORD NOWRT OCTA
  2 $LINK$                                  44 NOPIC CON REL LCL NOSHR NOEXE   RD NOWRT OCTA
  3 $BLANK                                9600 NOPIC OVR REL GBL NOSHR NOEXE   RD   WRT OCTA

    Total Space Allocated                10664


ENTRY POINTS

 Address      Name

  1-00000000  RELAX2


VARIABLES

 Address  Type  Name  Address  Type Name Address Type  Name  Address Type   Name  Address  Type  Name

      **  L*4   DONE       **  R*4  EPS       ** I*4   I          ** I*4    J          **  R*4   XNEW


ARRAYS

 Address      Type  Name        Bytes  Dimensions

  3-00000000  R*4   X            9600  (40, 60)


LABELS

 Address      Label

  1-00000040  10


As shown in Example 2-6, a section size is specified as a number of bytes, expressed in decimal. A data address is specified as an offset from the start of a program section, expressed in hexadecimal.


Previous Next Contents Index