Previous | Contents | Index |
This appendix describes the three sections of an output listing produced by the Compaq Fortran compiler:
To request a listing file, use the -v option. For example:
% f90 -V peak.f90 |
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 C-1 shows a sample of a source-code section of a compiler output listing.
Example C-1 Sample Source Code Listing |
---|
RELAX2 Source Listing 14-Nov-2001 09:59:31 Compaq Fortran V5.5-1843 13-Feb-1998 11:00:18 listing.f90 1 SUBROUTINE RELAX2(EPS) 2 INTEGER, PARAMETER :: M=40 3 INTEGER, PARAMETER :: N=60 4 COMMON X (M,N) 5 LOGICAL DONE 6 1 DONE = .TRUE. 7 DO J=1,N-1 8 DO I=1,M-1 9 XNEW = (X(I-1,J)+X(I+1,J)+X(I,J-1)+X(I,J+1))/4 10 IF (ABS(XNEW-X(I,J)) > EPS) DONE = .FALSE. 11 X(I,J) = XNEW 12 END DO 13 END DO 14 IF (.NOT. DONE) GO TO 1 15 RETURN 16 END SUBROUTINE |
The first heading line contains "Source Listing," the date and time the listing file was created, and the version of Compaq Fortran.
The second line contains the creation date of the source file and its file name.
Compiler-generated line numbers appear in the left margin.
Compile-time error messages that contain line numbers refer to these
compiler-generated line numbers. See Section 2.3, Compiler Limits, Diagnostic Messages, and Error Conditions.
C.2 Machine-Code Section of the Output Listing
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 assembler language.
The machine-code section is optional. To create a listing file with a machine-code section, specify both the -v and -show code options. For example:
% f90 -c -V -show code peak.f90 |
Example C-2 shows a sample of a machine-code section of a compiler output listing for an Alpha system.
The machine code listing is for reference purposes only. Such code is not intended to be assembled and run. |
Example C-2 Sample Machine-Code Listing |
---|
RELAX2 Machine Code Listing 14-Nov-2001 09:59:31 Compaq Fortran V5.5-1843 13-Feb-1998 11:00:18 listing.f90 .text .globl relax2_ .ent relax2_ .eflag 16 0000 relax2_: 27BB0001 0000 ldah gp, relax2_ # gp, (r27) 2FFE0000 0004 unop 23BD8420 0008 lda gp, relax2_ # gp, (gp) 2FFE0000 000C unop 0010 L$1: 23DEFFD0 0010 lda sp, -48(sp) 88100000 0014 lds f0, (r16) # 000010 B75E0000 0018 stq r26, (sp) A79D8010 001C ldq r28, (gp) # 000009 A47D8018 0020 ldq r3, var$0004 # r3, 8(gp) 9C5E0008 0024 stt f2, 8(sp) # 000001 9C7E0010 0028 stt f3, 16(sp) 9C9E0018 002C stt f4, 24(sp) 20630000 0030 lda r3, var$0004 # r3, (r3) # 000009 9CBE0020 0034 stt f5, 32(sp) # 000001 9CDE0028 0038 stt f6, 40(sp) .mask 0x04000000,-48 .fmask 0x0000007C,-40 .frame $sp, 48, $26 .prologue 1 883C0000 003C lds f1, (r28) # 000009 0040 .1: # 000006 209FFFFF 0040 mov -1, DONE # -1, r4 47E77405 0044 mov 59, var$0002 # 59, r5 # 000007 47F41406 0048 mov 160, r6 # 000011 2FFE0000 004C unop 0050 lab$0004: # 000007 40660407 0050 addq r3, r6, r7 # 000009 47E4F408 0054 mov 39, var$0003 # 39, r8 # 000008 20E7FF5C 0058 lda r7, -164(r7) # 000009 2FFE0000 005C unop 0060 lab$0008: # 000008 89470008 0060 lds f10, 8(r7) # 000009 8987FF64 0064 lds f12, -156(r7) 47FF041B 0068 clr r27 # 000010 89670000 006C lds f11, (r7) # 000009 . . . Routine Size: 1012 bytes, Routine Base: $CODE$ + 0000 .rdata $$1: 00000000 0000 .quad .literal 00000000 0008 .quad _BLNK__ .rconst $$2: 3E800000 0000 .long 0x3E800000 # .float 0.2500000 .data $$3: 0000 ; Procedure descriptor for relax2_ ; flags :short ; rsa_offset : 0 ; imask : 0x00 ; fmask : 0x1F ; frame_size : 6 ; sp_set : 4 ; entry_length : 15 .data $$4: 0000 ; Code range descriptor for relax2_ beginaddress : 0000 rpd_offset : 0000 flags : Standard .comm _BLNK__ 9600 |
Like a source listing, the first heading line contains the name of the program, subroutine, or function; the date and time the listing file was created; and the version of Compaq Fortran.
The second heading line contains "Machine Code Listing," the creation date of the source file, and the name of the source file.
The third heading line contains a .section assembler directive, indicating the attributes of the machine-code program unit. The $CODE$ shown in Example C-2 indicates a code section.
The lines following each data program section provide information such as the contents of storage initialized for FORMAT statements, DATA statements, constants, and subprogram argument call lists.
The lines following
$CODE$
show the machine instructions represented in the form of Alpha
assembler mnemonics and syntax. Each line contains compiler-generated
object code starting at the left margin, followed by the hexadecimal
byte offset (four hexadecimal digits), followed by the actual assembler
code.
C.2.2 Assembler Code Represented in Machine-Code Listings
General registers (0 through 31) are represented by r0 through r31 and floating-point registers are similarly represented by fn .
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 variable names may be missing.
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 -o0 .
The compiler may 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.
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 lines.
C.3 Compilation Summary of the Output Listing
The final entries on the compiler listing are the compiler options and compiler statistics.
The options shown include the ones specified on the command line, both f90 and fort , and the ones in effect as defaults during the compilation. The compiler statistics are the machine resources used by the compiler.
Example C-3 shows how compiler options and f90 (on Tru64 UNIX systems) command-line options and compilation statistics appear on the listing.
A summary of compilation statistics appears at the end of the listing file.
Example C-3 Sample Compilation Summary on Tru64 UNIX Systems |
---|
COMPILER OPTIONS BEING USED no -align commons no -align dcommons -align records no -align sequence no -align rec1byte no -align rec2byte no -align rec4byte no -align rec8byte -altparam no -annotations code no -annotations detail no -annotations feedback no -annotations inlining no -annotations loop_transforms no -annotations loop_unrolling no -annotations prefetching no -annotations shrinkwrapping no -annotations software_pipelining no -annotations tail_calls no -annotations tail_recursion -arch generic -assume accuracy_sensitive no -assume bigarrays no -assume buffered_io no -assume byterecl no -assume cc_omp no -assume dummy_aliases no -assume gfullpath no -assume minus0 -assume protect_constants no -assume pthreads_lock -assume source_include -assume underscore no -assume 2underscores -assume zsize no -automatic no -bintext -call_shared -ccdefault default no -check arg_temp_created no -check bounds no -check format no -check omp_bindings no -check output_conversion no -check overflow -check power no -check underflow -convert native no -D -double_size 64 no -d_lines -error_limit 30 no -extend_source no -f66 no -f77rtl no -fast no -fpscomp filesfromcmd no -fpscomp general no -fpscomp ioformat no -fpscomp ldio_spacing no -fpscomp logicals no -fpconstant -fpe0 -fprm nearest -free -g1 -granularity quadword -Gt0 no -hpf_matmul no -hpf -iface no -intconstant -integer_size 32 no -ladebug -machine_code -math_library accurate no -mixed_str_len_arg no -module -names lowercase -nearest_neighbor no -nohpf_main no -non_shared no -noinclude -numnodes 0 no -numa -numa_memories 0 -numa_tpm 0 -O4 -inline speed no -transform_loops -pipeline -speculate none -tune generic -unroll 0 no -pad_source no -pg -real_size 32 no -recursive -reentrancy none -shadow_width 0 no -shared no -show hpf_all no -show hpf_comm no -show hpf_default no -show hpf_dev no -show hpf_indep no -show hpf_nearest no -show hpf_punt no -show hpf_temps no -show include -show map no -show wsfinfo no -std no -synchronous_exceptions no -syntax_only no -vms -warn alignments no -warn argument_checking no -warn declarations -warn general -warn granularity no -warn hpf no -warn ignore_loc no -warn truncated_source -warn uncalled -warn uninitialized no -warn unused -warn usage -warning_severity warning no -fuse_xref -I path : /usr/lib/cmplrs/hpfrtl/,/usr/include/ -V filename : listing.l -o filename : listing.o COMPILER: Compaq Fortran V5.5-1843-48BB1 |
Example C-4 shows how compiler options and fort (on Linux systems) command-line options and compilation statistics appear on the listing.
A summary of compilation statistics appears at the end of the listing file. Note that some options that are available on Tru64 UNIX systems are not available on Linux Alpha systems.
Example C-4 Sample Compilation Summary on Linux Systems |
---|
COMPILER OPTIONS BEING USED no -align commons no -align dcommons -align records no -align sequence no -align rec1byte no -align rec2byte no -align rec4byte no -align rec8byte -altparam no -annotations code no -annotations detail no -annotations feedback no -annotations inlining no -annotations loop_transforms no -annotations loop_unrolling no -annotations prefetching no -annotations shrinkwrapping no -annotations software_pipelining no -annotations tail_calls no -annotations tail_recursion -arch generic -assume accuracy_sensitive no -assume bigarrays no -assume buffered_io no -assume byterecl no -assume cc_omp no -assume dummy_aliases no -assume gfullpath no -assume minus0 -assume protect_constants no -assume pthreads_lock -assume source_include -assume underscore -assume 2underscores -assume zsize no -automatic no -bintext -call_shared -ccdefault default no -check arg_temp_created no -check bounds no -check format no -check omp_bindings no -check output_conversion no -check overflow -check power no -check underflow -convert native no -D -double_size 64 no -d_lines -error_limit 30 no -extend_source no -f66 no -f77rtl no -fast no -fpscomp filesfromcmd no -fpscomp general no -fpscomp ioformat no -fpscomp ldio_spacing no -fpscomp logicals -fixed no -fpconstant -fpe0 -fprm nearest -g1 -granularity quadword -Gt0 no -hpf_matmul no -hpf -iface no -intconstant -integer_size 32 no -ladebug no -machine_code -math_library accurate no -mixed_str_len_arg no -module -names lowercase -nearest_neighbor no -nohpf_main no -non_shared no -noinclude -numnodes 0 no -numa -numa_memories 0 -numa_tpm 0 -O4 -inline speed no -transform_loops -pipeline -speculate none -tune generic -unroll 0 no -pad_source no -pg -real_size 32 no -recursive -reentrancy none -shadow_width 0 no -shared no -show hpf_all no -show hpf_comm no -show hpf_default no -show hpf_dev no -show hpf_indep no -show hpf_nearest no -show hpf_punt no -show hpf_temps no -show include -show map no -show wsfinfo no -std no -synchronous_exceptions no -syntax_only no -vms -warn alignments no -warn argument_checking no -warn declarations -warn general -warn granularity no -warn hpf no -warn ignore_loc no -warn truncated_source -warn uncalled -warn uninitialized no -warn unused -warn usage -warning_severity warning no -fuse_xref -I path : /usr/include/ -V filename : end.l -o filename : /tmp/forlYrc7r.o COMPILER: Compaq Fortran V1.2.0-1843-48BB1 |
Previous | Next | Contents | Index |