1 07/16/86 new_fortran options
2
3 This segment describes in detail the new_fortran control arguments
4 used to invoke the optimizer, the %options and %global statements, and
5 the relationship between control arguments and %options or %global
6 keywords.
7
8
9 Invoking the optimizer:
10 The optimizing phase of the compiler may be invoked by including
11 either of the control arguments -optimize -ot or -safe_optimize
12 -safe_ot on the command line used to invoke the compiler.
13
14 The -full_optimize control argument invokes a phase to perform the
15 following global optimizations: common subexpression removal, removal
16 of invariants from loops, strength reduction, test replacement,
17 constant propagation, and removal of useless assignments. Machine
18 dependant global optimizations such as pulling register loads out of
19 loops and global register allocation are also performed, as well as
20 various local optimizations.
21
22
23 The -safe_optimize control argument causes the same optimizations to
24 occur, except that certain invariant operations within a loop that are
25 not always executed when the loop is entered will not be moved out of
26 the loop. Operations which could cause division by zero or other
27 error conditions are never removed in either mode.
28
29 The -full_optimize control argument will give correct results for
30 almost all proper FORTRAN programs. The -safe_optimize control
31 argument should be used only in the very unusual circumstance that a
32 valid program signals the fixedoverflow, underflow, or overflow
33 condition when optimized, when the unoptimized version did not signal
34 such a condition.
35
36
37 The -optimize control argument will invoke the default optimizer which
38 will be either of '-full_optimize' or '-safe_optimize'. The default
39 optimizer can be changed by the options: 'default_full' and
40 'default_safe'. The 'default_full' argument is the default.
41
42
43 %global and %options statements:
44 The %global and %options program statements can be used to specify
45 certain optional behavior which is required in a given compilation or
46 individual program unit. The syntax of these statements is:
47
48 %global keyword,keyword,...;
49 %options keyword,keyword,...,
50
51 where the keywords may be chosen from the list below.
52
53 If a %global statement is used, it must appear first in the source
54 segment. %global lines may not be continued, but more than one may be
55 used if needed. Control arguments given on the command line override
56 conflicting options specified on a %global line. A warning message is
57 printed when this happens. If conflicting options appear on the
58 %global lines, a warning message will be printed, and the last
59 option seen will be used.
60
61
62 The %options statement is used to specify specific options for a
63 single compilation unit program subroutine function or block
64 data. Options specified on a %options statement override those given
65 in a %global statement and control arguments given on the command
66 line. The %options statement must precede all other statements in the
67 compilation unit, including implicit statements, comments, the
68 subroutine, function or block data statement, etc. The options
69 specified in a %options statement are in effect only for the
70 compilation of the single routine within the compilation unit. This
71 feature will, among other things, allow mixing of card and free form
72 input in one source segment. If conflicting options appear on the
73 %options lines, a warning message will be printed, and the last
74 option seen will be used.
75
76
77 List of keywords:
78 Key: A = control argument, G = %global, O = %options
79
80 AGO ansi66 A full_optimize
81 AGO ansi77 AG hexadecimal_floating_point
82 AGO auto AG la_auto
83 AG auto_zero AG la_static
84 AG binary_floating_point AG large_array
85 A brief A line_numbers
86 A brief_table A list
87 AGO card A long
88 A check A long_profile
89 AGO check_multiply A map
90 AGO default_full AG no_auto_zero
91 AGO default_safe A no_check
92 AGO fold AGO no_check_multiply
93 AGO free AGO no_fold
94
95
96 AG no_large_array A safe_optimize
97 A no_line_numbers A severityN
98 A no_map AGO static
99 A no_optimize AGO stringrange
100 AGO no_stringrange AGO subscriptrange
101 AGO no_subscriptrange A table
102 A no_table A time
103 A no_version A time_ot
104 AG no_very_large_array AGO truncate
105 AG no_vla_parm A version
106 A non_relocatable AG very_large_array
107 A optimize AG very_large_common
108 A profile AG vla_auto
109 A relocatable AG vla_parm
110 AGO round AG vla_static
111
112
113 Explanation of %global & %options keywords:
114 ansi66
115 The program is interpreted according to the 1966 standard for
116 FORTRAN, with Multics FORTRAN extensions. This is the default.
117 ansi77
118 The program is interpreted according to the 1977 standard for
119 FORTRAN, with Multics FORTRAN extensions.
120 auto
121 Makes automatic the default storage class. Ignored if a SAVE or
122 AUTOMATIC statement was used. This is the default.
123 auto_zero
124 Automatic storage should be set to zero when allocated. May not be
125 used in a %options statement. This is the default.
126
127
128 binary_floating_point, bfp
129 Floating point numbers are have an internal representation of 2 **
130 exponent * mantissa. This is the default.
131 card
132 Source is in card image format. Implies fold.
133 check_multiply, ckmpy
134 Add extra code to check to see if integer multiplication has
135 resulted in an overflow.
136 default_full, dff
137 Set the default optimizer to be the 'full_optimizer'. See
138 '-optimize' and '-full_optimize'
139
140
141 default_safe, dfs
142 Set the default optimizer to be the 'safe_optimizer'. See
143 '-optimize' and '-safe_optimize'
144 fold
145 Upper case letters are mapped to lower case outside of character
146 string constants.
147 free
148 Source is in free form format. Upper and lower case letters are
149 distinct.
150 hexadecimal_floating_point, hfp
151 Floating point numbers have an internal representation of 16 **
152 exponent * mantissa.
153
154
155 la_auto
156 Used when more automatic storage is required by a program than
157 would fit in the linkage section/stack frame. This still
158 restricts individual automatic arrays to 255K words max segment
159 size. May not be used in %options statements.
160 la_static
161 Used when more static storage is required by a program than would
162 fit in the linkage section/stack frame. This still restricts
163 individual static arrays to 255K words max segment size. May not
164 be used in %options statements.
165
166
167 large_array, la
168 Used when more static or automatic storage is required by a program
169 than would fit in the linkage section/stack frame. This still
170 restricts individual arrays and common blocks to 255K words max
171 segment size. 'la' large array can't be used in %options
172 statements. 'la' implies 'la_auto' and 'la_static'.
173
174
175 no_auto_zero
176 Do not zero automatic storage. May not be used in a %options
177 statement.
178 no_check_multiply, nckmpy
179 Do not generate code to check to see if integer multiplication has
180 resulted in an overflow.
181 no_fold
182 Uppercase letters are not mapped into lowercase form.
183
184
185 no_large_array, nla
186 Large array support is not needed. May not be used in a %options
187 statement.
188 no_stringrange, nstrg
189 Do not generate range checking code for substrings.
190 no_subscriptrange, nsubrg
191 Do not generate range checking code for subscripts.
192 no_very_large_array, nvla
193 very large array support is not needed. May not be used in a
194 %options statement.
195 no_vla_parm
196 no very large array parameters. May not be used in a %options
197 statement.
198
199
200 round
201 Intermediate and final results of floating point calculations
202 should be rounded before storing. This is the default.
203 static
204 Makes static the default storage class for variables in the
205 program. Ignored if a SAVE or AUTOMATIC statment is used in
206 the program.
207 stringrange, strg
208 Code should be generated to perform substring range checking.
209 Ignored if optimization is being done.
210 subscriptrange, subrg
211 Code should be generated to perform subscript range checking.
212 Ignored if optimization is being done.
213
214
215 truncate
216 Intermediate and final results of floating point calculations
217 should be truncated before storing.
218 very_large_array, vla
219 Used when arrays and/or common blocks must exceed 255K words
220 segment size. 'vla' very large array may not be used in
221 %options statements. 'vla' also implies 'la', 'vlc', 'vla_auto',
222 'vla_parm', and 'vla_static'.
223 very_large_common, vlc
224 Used when common blocks must exceed 255K words segment size.
225 'vlc' very large common may not be used in %options statements.
226 'vlc' also implies 'vla_parm'.
227
228
229 vla_auto
230 Used when automatic arrays must exceed 255K words segment size.
231 May not be used in %options statements. It implies 'la_auto' and
232 'vla_parm'.
233 vla_parm
234 Used when a subroutine is passed parameters that might be vla
235 very large arrays. May not be used in %options statements.
236 vla_static
237 Used when static arrays must exceed 255K words segment size.
238 May not be used in %options statements. It implies 'la_static'
239 and 'vla_parm'.
240
241
242 Notes:
243 For a complete list of control arguments accepted by new_fortran,
244 type "help new_fortran".