2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / f / bugs.texi
blob176072c0d21428b7409ff84833f3847161a6e484
1 @c Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
2 @c This is part of the G77 manual.
3 @c For copying conditions, see the file g77.texi.
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.
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
12 @set last-update-bugs 2002-02-01
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.
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.
29 @node Top,,, (dir)
30 @chapter Known Bugs In GNU Fortran
31 @end ifset
33 @ifset DOC-G77
34 @node Known Bugs
35 @section Known Bugs In GNU Fortran
36 @end ifset
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.
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
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
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}.
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
77 An online, ``live'' version of this document
78 (derived directly from the mainline, development version
79 of @code{g77} within @code{gcc})
80 is available via
81 @uref{http://gcc.gnu.org/onlinedocs/g77/Trouble.html}.
82 Follow the ``Known Bugs'' link.
84 The following information was last updated on @value{last-update-bugs}:
86 @itemize @bullet
87 @item
88 @code{g77} fails to warn about
89 use of a ``live'' iterative-DO variable
90 as an implied-DO variable
91 in a @code{WRITE} or @code{PRINT} statement
92 (although it does warn about this in a @code{READ} statement).
94 @item
95 Something about @code{g77}'s straightforward handling of
96 label references and definitions sometimes prevents the GBE
97 from unrolling loops.
98 Until this is solved, try inserting or removing @code{CONTINUE}
99 statements as the terminal statement, using the @code{END DO}
100 form instead, and so on.
102 @item
103 Some confusion in diagnostics concerning failing @code{INCLUDE}
104 statements from within @code{INCLUDE}'d or @code{#include}'d files.
106 @cindex integer constants
107 @cindex constants, integer
108 @item
109 @code{g77} assumes that @code{INTEGER(KIND=1)} constants range
110 from @samp{-2**31} to @samp{2**31-1} (the range for
111 two's-complement 32-bit values),
112 instead of determining their range from the actual range of the
113 type for the configuration (and, someday, for the constant).
115 Further, it generally doesn't implement the handling
116 of constants very well in that it makes assumptions about the
117 configuration that it no longer makes regarding variables (types).
119 Included with this item is the fact that @code{g77} doesn't recognize
120 that, on IEEE-754/854-compliant systems, @samp{0./0.} should produce a NaN
121 and no warning instead of the value @samp{0.} and a warning.
123 @cindex compiler speed
124 @cindex speed, of compiler
125 @cindex compiler memory usage
126 @cindex memory usage, of compiler
127 @cindex large aggregate areas
128 @cindex initialization, bug
129 @cindex DATA statement
130 @cindex statements, DATA
131 @item
132 @code{g77} uses way too much memory and CPU time to process large aggregate
133 areas having any initialized elements.
135 For example, @samp{REAL A(1000000)} followed by @samp{DATA A(1)/1/}
136 takes up way too much time and space, including
137 the size of the generated assembler file.
139 Version 0.5.18 improves cases like this---specifically,
140 cases of @emph{sparse} initialization that leave large, contiguous
141 areas uninitialized---significantly.
142 However, even with the improvements, these cases still
143 require too much memory and CPU time.
145 (Version 0.5.18 also improves cases where the initial values are
146 zero to a much greater degree, so if the above example
147 ends with @samp{DATA A(1)/0/}, the compile-time performance
148 will be about as good as it will ever get, aside from unrelated
149 improvements to the compiler.)
151 Note that @code{g77} does display a warning message to
152 notify the user before the compiler appears to hang.
153 @ifset DOC-G77
154 A warning message is issued when @code{g77} sees code that provides
155 initial values (e.g. via @code{DATA}) to an aggregate area (@code{COMMON}
156 or @code{EQUIVALENCE}, or even a large enough array or @code{CHARACTER}
157 variable)
158 that is large enough to increase @code{g77}'s compile time by roughly
159 a factor of 10.
161 This size currently is quite small, since @code{g77}
162 currently has a known bug requiring too much memory
163 and time to handle such cases.
164 In @file{@value{path-g77}/data.c}, the macro
165 @code{FFEDATA_sizeTOO_BIG_INIT_} is defined
166 to the minimum size for the warning to appear.
167 The size is specified in storage units,
168 which can be bytes, words, or whatever, on a case-by-case basis.
170 After changing this macro definition, you must
171 (of course) rebuild and reinstall @code{g77} for
172 the change to take effect.
174 Note that, as of version 0.5.18, improvements have
175 reduced the scope of the problem for @emph{sparse}
176 initialization of large arrays, especially those
177 with large, contiguous uninitialized areas.
178 However, the warning is issued at a point prior to
179 when @code{g77} knows whether the initialization is sparse,
180 and delaying the warning could mean it is produced
181 too late to be helpful.
183 Therefore, the macro definition should not be adjusted to
184 reflect sparse cases.
185 Instead, adjust it to generate the warning when densely
186 initialized arrays begin to cause responses noticeably slower
187 than linear performance would suggest.
188 @end ifset
190 @cindex code, displaying main source
191 @cindex displaying main source code
192 @cindex debugging main source code
193 @cindex printing main source
194 @item
195 When debugging, after starting up the debugger but before being able
196 to see the source code for the main program unit, the user must currently
197 set a breakpoint at @code{MAIN__} (or @code{MAIN___} or @code{MAIN_} if
198 @code{MAIN__} doesn't exist)
199 and run the program until it hits the breakpoint.
200 At that point, the
201 main program unit is activated and about to execute its first
202 executable statement, but that's the state in which the debugger should
203 start up, as is the case for languages like C.
205 @cindex debugger
206 @item
207 Debugging @code{g77}-compiled code using debuggers other than
208 @code{gdb} is likely not to work.
210 Getting @code{g77} and @code{gdb} to work together is a known
211 problem---getting @code{g77} to work properly with other
212 debuggers, for which source code often is unavailable to @code{g77}
213 developers, seems like a much larger, unknown problem,
214 and is a lower priority than making @code{g77} and @code{gdb}
215 work together properly.
217 On the other hand, information about problems other debuggers
218 have with @code{g77} output might make it easier to properly
219 fix @code{g77}, and perhaps even improve @code{gdb}, so it
220 is definitely welcome.
221 Such information might even lead to all relevant products
222 working together properly sooner.
224 @cindex Alpha, support
225 @cindex support, Alpha
226 @item
227 @code{g77} doesn't work perfectly on 64-bit configurations
228 such as the Digital Semiconductor (``DEC'') Alpha.
230 This problem is largely resolved as of version 0.5.23.
232 @cindex padding
233 @cindex structures
234 @cindex common blocks
235 @cindex equivalence areas
236 @item
237 @code{g77} currently inserts needless padding for things like
238 @samp{COMMON A,IPAD} where @samp{A} is @code{CHARACTER*1} and @samp{IPAD}
239 is @code{INTEGER(KIND=1)} on machines like x86,
240 because the back end insists that @samp{IPAD}
241 be aligned to a 4-byte boundary,
242 but the processor has no such requirement
243 (though it is usually good for performance).
245 The @code{gcc} back end needs to provide a wider array
246 of specifications of alignment requirements and preferences for targets,
247 and front ends like @code{g77} should take advantage of this
248 when it becomes available.
250 @cindex complex performance
251 @cindex aliasing
252 @item
253 The @code{libf2c} routines that perform some run-time
254 arithmetic on @code{COMPLEX} operands
255 were modified circa version 0.5.20 of @code{g77}
256 to work properly even in the presence of aliased operands.
258 While the @code{g77} and @code{netlib} versions of @code{libf2c}
259 differ on how this is accomplished,
260 the main differences are that we believe
261 the @code{g77} version works properly
262 even in the presence of @emph{partially} aliased operands.
264 However, these modifications have reduced performance
265 on targets such as x86,
266 due to the extra copies of operands involved.
267 @end itemize