Mention KTR_IFQ and KTR_IF_START
[dragonfly.git] / contrib / gcc-3.4 / gcc / f / bugs.texi
1 @c Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
2 @c This is part of the G77 manual.
3 @c For copying conditions, see the file g77.texi.
4
5 @c The text of this file appears in the file BUGS
6 @c in the G77 distribution, as well as in the G77 manual.
7
8 @c Keep this the same as the dates above, since it's used
9 @c in the standalone derivations of this file (e.g. BUGS).
10 @set copyrights-bugs 1995,1996,1997,1998,1999,2000,2001,2002,2004
11
12 @set last-update-bugs 2004-05-18
13
14 @ifset DOC-BUGS
15 @include root.texi
16 @c The immediately following lines apply to the BUGS file
17 @c which is derived from this file.
18 @emph{Note:} This file is automatically generated from the files
19 @file{bugs0.texi} and @file{bugs.texi}.
20 @file{BUGS} is @emph{not} a source file,
21 although it is normally included within source distributions.
22
23 This file lists known bugs in the @value{which-g77} version
24 of the GNU Fortran compiler.
25 Copyright (C) @value{copyrights-bugs} Free Software Foundation, Inc.
26 You may copy, distribute, and modify it freely as long as you preserve
27 this copyright notice and permission notice.
28
29 @node Top,,, (dir)
30 @chapter Known Bugs In GNU Fortran
31 @end ifset
32
33 @ifset DOC-G77
34 @node Known Bugs
35 @section Known Bugs In GNU Fortran
36 @end ifset
37
38 This section identifies bugs that @code{g77} @emph{users}
39 might run into in the @value{which-g77} version
40 of @code{g77}.
41 This includes bugs that are actually in the @code{gcc}
42 back end (GBE) or in @code{libf2c}, because those
43 sets of code are at least somewhat under the control
44 of (and necessarily intertwined with) @code{g77},
45 so it isn't worth separating them out.
46
47 @ifset DOC-G77
48 For information on bugs in @emph{other} versions of @code{g77},
49 see @ref{News,,News About GNU Fortran}.
50 There, lists of bugs fixed in various versions of @code{g77}
51 can help determine what bugs existed in prior versions.
52 @end ifset
53
54 @ifset DOC-BUGS
55 For information on bugs in @emph{other} versions of @code{g77},
56 see @file{@value{path-g77}/NEWS}.
57 There, lists of bugs fixed in various versions of @code{g77}
58 can help determine what bugs existed in prior versions.
59 @end ifset
60
61 @ifset DEVELOPMENT
62 @emph{Warning:} The information below is still under development,
63 and might not accurately reflect the @code{g77} code base
64 of which it is a part.
65 Efforts are made to keep it somewhat up-to-date,
66 but they are particularly concentrated
67 on any version of this information
68 that is distributed as part of a @emph{released} @code{g77}.
69
70 In particular, while this information is intended to apply to
71 the @value{which-g77} version of @code{g77},
72 only an official @emph{release} of that version
73 is expected to contain documentation that is
74 most consistent with the @code{g77} product in that version.
75 @end ifset
76
77 The following information was last updated on @value{last-update-bugs}:
78
79 @itemize @bullet
80 @item
81 @code{g77} fails to warn about
82 use of a ``live'' iterative-DO variable
83 as an implied-DO variable
84 in a @code{WRITE} or @code{PRINT} statement
85 (although it does warn about this in a @code{READ} statement).
86
87 @item
88 Something about @code{g77}'s straightforward handling of
89 label references and definitions sometimes prevents the GBE
90 from unrolling loops.
91 Until this is solved, try inserting or removing @code{CONTINUE}
92 statements as the terminal statement, using the @code{END DO}
93 form instead, and so on.
94
95 @item
96 Some confusion in diagnostics concerning failing @code{INCLUDE}
97 statements from within @code{INCLUDE}'d or @code{#include}'d files.
98
99 @cindex integer constants
100 @cindex constants, integer
101 @item
102 @code{g77} assumes that @code{INTEGER(KIND=1)} constants range
103 from @samp{-2**31} to @samp{2**31-1} (the range for
104 two's-complement 32-bit values),
105 instead of determining their range from the actual range of the
106 type for the configuration (and, someday, for the constant).
107
108 Further, it generally doesn't implement the handling
109 of constants very well in that it makes assumptions about the
110 configuration that it no longer makes regarding variables (types).
111
112 Included with this item is the fact that @code{g77} doesn't recognize
113 that, on IEEE-754/854-compliant systems, @samp{0./0.} should produce a NaN
114 and no warning instead of the value @samp{0.} and a warning.
115
116 @cindex compiler speed
117 @cindex speed, of compiler
118 @cindex compiler memory usage
119 @cindex memory usage, of compiler
120 @cindex large aggregate areas
121 @cindex initialization, bug
122 @cindex DATA statement
123 @cindex statements, DATA
124 @item
125 @code{g77} uses way too much memory and CPU time to process large aggregate
126 areas having any initialized elements.
127
128 For example, @samp{REAL A(1000000)} followed by @samp{DATA A(1)/1/}
129 takes up way too much time and space, including
130 the size of the generated assembler file.
131
132 Version 0.5.18 improves cases like this---specifically,
133 cases of @emph{sparse} initialization that leave large, contiguous
134 areas uninitialized---significantly.
135 However, even with the improvements, these cases still
136 require too much memory and CPU time.
137
138 (Version 0.5.18 also improves cases where the initial values are
139 zero to a much greater degree, so if the above example
140 ends with @samp{DATA A(1)/0/}, the compile-time performance
141 will be about as good as it will ever get, aside from unrelated
142 improvements to the compiler.)
143
144 Note that @code{g77} does display a warning message to
145 notify the user before the compiler appears to hang.
146 @ifset DOC-G77
147 A warning message is issued when @code{g77} sees code that provides
148 initial values (e.g. via @code{DATA}) to an aggregate area (@code{COMMON}
149 or @code{EQUIVALENCE}, or even a large enough array or @code{CHARACTER}
150 variable)
151 that is large enough to increase @code{g77}'s compile time by roughly
152 a factor of 10.
153
154 This size currently is quite small, since @code{g77}
155 currently has a known bug requiring too much memory
156 and time to handle such cases.
157 In @file{@value{path-g77}/data.c}, the macro
158 @code{FFEDATA_sizeTOO_BIG_INIT_} is defined
159 to the minimum size for the warning to appear.
160 The size is specified in storage units,
161 which can be bytes, words, or whatever, on a case-by-case basis.
162
163 After changing this macro definition, you must
164 (of course) rebuild and reinstall @code{g77} for
165 the change to take effect.
166
167 Note that, as of version 0.5.18, improvements have
168 reduced the scope of the problem for @emph{sparse}
169 initialization of large arrays, especially those
170 with large, contiguous uninitialized areas.
171 However, the warning is issued at a point prior to
172 when @code{g77} knows whether the initialization is sparse,
173 and delaying the warning could mean it is produced
174 too late to be helpful.
175
176 Therefore, the macro definition should not be adjusted to
177 reflect sparse cases.
178 Instead, adjust it to generate the warning when densely
179 initialized arrays begin to cause responses noticeably slower
180 than linear performance would suggest.
181 @end ifset
182
183 @cindex code, displaying main source
184 @cindex displaying main source code
185 @cindex debugging main source code
186 @cindex printing main source
187 @item
188 When debugging, after starting up the debugger but before being able
189 to see the source code for the main program unit, the user must currently
190 set a breakpoint at @code{MAIN__} (or @code{MAIN___} or @code{MAIN_} if
191 @code{MAIN__} doesn't exist)
192 and run the program until it hits the breakpoint.
193 At that point, the
194 main program unit is activated and about to execute its first
195 executable statement, but that's the state in which the debugger should
196 start up, as is the case for languages like C.
197
198 @cindex debugger
199 @item
200 Debugging @code{g77}-compiled code using debuggers other than
201 @code{gdb} is likely not to work.
202
203 Getting @code{g77} and @code{gdb} to work together is a known
204 problem---getting @code{g77} to work properly with other
205 debuggers, for which source code often is unavailable to @code{g77}
206 developers, seems like a much larger, unknown problem,
207 and is a lower priority than making @code{g77} and @code{gdb}
208 work together properly.
209
210 On the other hand, information about problems other debuggers
211 have with @code{g77} output might make it easier to properly
212 fix @code{g77}, and perhaps even improve @code{gdb}, so it
213 is definitely welcome.
214 Such information might even lead to all relevant products
215 working together properly sooner.
216
217 @cindex Alpha, support
218 @cindex support, Alpha
219 @item
220 @code{g77} doesn't work perfectly on 64-bit configurations
221 such as the Digital Semiconductor (``DEC'') Alpha.
222
223 This problem is largely resolved as of version 0.5.23.
224
225 @cindex padding
226 @cindex structures
227 @cindex common blocks
228 @cindex equivalence areas
229 @item
230 @code{g77} currently inserts needless padding for things like
231 @samp{COMMON A,IPAD} where @samp{A} is @code{CHARACTER*1} and @samp{IPAD}
232 is @code{INTEGER(KIND=1)} on machines like x86,
233 because the back end insists that @samp{IPAD}
234 be aligned to a 4-byte boundary,
235 but the processor has no such requirement
236 (though it is usually good for performance).
237
238 The @code{gcc} back end needs to provide a wider array
239 of specifications of alignment requirements and preferences for targets,
240 and front ends like @code{g77} should take advantage of this
241 when it becomes available.
242
243 @cindex complex performance
244 @cindex aliasing
245 @item
246 The @code{libf2c} routines that perform some run-time
247 arithmetic on @code{COMPLEX} operands
248 were modified circa version 0.5.20 of @code{g77}
249 to work properly even in the presence of aliased operands.
250
251 While the @code{g77} and @code{netlib} versions of @code{libf2c}
252 differ on how this is accomplished,
253 the main differences are that we believe
254 the @code{g77} version works properly
255 even in the presence of @emph{partially} aliased operands.
256
257 However, these modifications have reduced performance
258 on targets such as x86,
259 due to the extra copies of operands involved.
260 @end itemize