OSDN Git Service

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