Adjust the C++ preprocessor to include /usr/include/c++ by default for
[dragonfly.git] / contrib / gcc / f / bugs.texi
1 @c Copyright (C) 1995-1999 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-1999
11
12 @set last-update-bugs 1999-06-29
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{egcs})
81 is available via
82 @uref{http://www.gnu.org/software/gcc/onlinedocs/g77_bugs.html}.
83 Follow the ``Known Bugs'' link.
84
85 @ifset DOC-G77
86 For information on bugs that might afflict people who
87 configure, port, build, and install @code{g77},
88 see @ref{Problems Installing}.
89 @end ifset
90
91 @ifset DOC-BUGS
92 For information on bugs that might afflict people who
93 configure, port, build, and install @code{g77},
94 see "Problems Installing" in @file{@value{path-g77}/INSTALL}.
95 @end ifset
96
97 The following information was last updated on @value{last-update-bugs}:
98
99 @itemize @bullet
100 @item
101 @code{g77} fails to warn about
102 use of a ``live'' iterative-DO variable
103 as an implied-DO variable
104 in a @code{WRITE} or @code{PRINT} statement
105 (although it does warn about this in a @code{READ} statement).
106
107 @item
108 Something about @code{g77}'s straightforward handling of
109 label references and definitions sometimes prevents the GBE
110 from unrolling loops.
111 Until this is solved, try inserting or removing @code{CONTINUE}
112 statements as the terminal statement, using the @code{END DO}
113 form instead, and so on.
114
115 @item
116 Some confusion in diagnostics concerning failing @code{INCLUDE}
117 statements from within @code{INCLUDE}'d or @code{#include}'d files.
118
119 @cindex integer constants
120 @cindex constants, integer
121 @item
122 @code{g77} assumes that @code{INTEGER(KIND=1)} constants range
123 from @samp{-2**31} to @samp{2**31-1} (the range for
124 two's-complement 32-bit values),
125 instead of determining their range from the actual range of the
126 type for the configuration (and, someday, for the constant).
127
128 Further, it generally doesn't implement the handling
129 of constants very well in that it makes assumptions about the
130 configuration that it no longer makes regarding variables (types).
131
132 Included with this item is the fact that @code{g77} doesn't recognize
133 that, on IEEE-754/854-compliant systems, @samp{0./0.} should produce a NaN
134 and no warning instead of the value @samp{0.} and a warning.
135 This is to be fixed in version 0.6, when @code{g77} will use the
136 @code{gcc} back end's constant-handling mechanisms to replace its own.
137
138 @cindex compiler speed
139 @cindex speed, of compiler
140 @cindex compiler memory usage
141 @cindex memory usage, of compiler
142 @cindex large aggregate areas
143 @cindex initialization, bug
144 @cindex DATA statement
145 @cindex statements, DATA
146 @item
147 @code{g77} uses way too much memory and CPU time to process large aggregate
148 areas having any initialized elements.
149
150 For example, @samp{REAL A(1000000)} followed by @samp{DATA A(1)/1/}
151 takes up way too much time and space, including
152 the size of the generated assembler file.
153 This is to be mitigated somewhat in version 0.6.
154
155 Version 0.5.18 improves cases like this---specifically,
156 cases of @emph{sparse} initialization that leave large, contiguous
157 areas uninitialized---significantly.
158 However, even with the improvements, these cases still
159 require too much memory and CPU time.
160
161 (Version 0.5.18 also improves cases where the initial values are
162 zero to a much greater degree, so if the above example
163 ends with @samp{DATA A(1)/0/}, the compile-time performance
164 will be about as good as it will ever get, aside from unrelated
165 improvements to the compiler.)
166
167 Note that @code{g77} does display a warning message to
168 notify the user before the compiler appears to hang.
169 @ifset DOC-G77
170 @xref{Large Initialization,,Initialization of Large Aggregate Areas},
171 for information on how to change the point at which
172 @code{g77} decides to issue this warning.
173 @end ifset
174
175 @cindex debugging
176 @cindex common blocks
177 @cindex equivalence areas
178 @cindex local equivalence areas
179 @item
180 @code{g77} doesn't emit variable and array members of common blocks for use
181 with a debugger (the @samp{-g} command-line option).
182 The code is present to do this, but doesn't work with at least
183 one debug format---perhaps it works with others.
184 And it turns out there's a similar bug for
185 local equivalence areas, so that has been disabled as well.
186
187 As of Version 0.5.19, a temporary kludge solution is provided whereby
188 some rudimentary information on a member is written as a string that
189 is the member's value as a character string.
190
191 @ifset DOC-G77
192 @xref{Code Gen Options,,Options for Code Generation Conventions},
193 for information on the @samp{-fdebug-kludge} option.
194 @end ifset
195
196 @cindex code, displaying main source
197 @cindex displaying main source code
198 @cindex debugging main source code
199 @cindex printing main source
200 @item
201 When debugging, after starting up the debugger but before being able
202 to see the source code for the main program unit, the user must currently
203 set a breakpoint at @code{MAIN__} (or @code{MAIN___} or @code{MAIN_} if
204 @code{MAIN__} doesn't exist)
205 and run the program until it hits the breakpoint.
206 At that point, the
207 main program unit is activated and about to execute its first
208 executable statement, but that's the state in which the debugger should
209 start up, as is the case for languages like C.
210
211 @cindex debugger
212 @item
213 Debugging @code{g77}-compiled code using debuggers other than
214 @code{gdb} is likely not to work.
215
216 Getting @code{g77} and @code{gdb} to work together is a known
217 problem---getting @code{g77} to work properly with other
218 debuggers, for which source code often is unavailable to @code{g77}
219 developers, seems like a much larger, unknown problem,
220 and is a lower priority than making @code{g77} and @code{gdb}
221 work together properly.
222
223 On the other hand, information about problems other debuggers
224 have with @code{g77} output might make it easier to properly
225 fix @code{g77}, and perhaps even improve @code{gdb}, so it
226 is definitely welcome.
227 Such information might even lead to all relevant products
228 working together properly sooner.
229
230 @cindex Alpha, support
231 @cindex support, Alpha
232 @item
233 @code{g77} doesn't work perfectly on 64-bit configurations
234 such as the Digital Semiconductor (``DEC'') Alpha.
235
236 This problem is largely resolved as of version 0.5.23.
237 Version 0.6 should solve most or all remaining problems
238 (such as cross-compiling involving 64-bit machines).
239
240 @cindex padding
241 @cindex structures
242 @cindex common blocks
243 @cindex equivalence areas
244 @item
245 @code{g77} currently inserts needless padding for things like
246 @samp{COMMON A,IPAD} where @samp{A} is @code{CHARACTER*1} and @samp{IPAD}
247 is @code{INTEGER(KIND=1)} on machines like x86,
248 because the back end insists that @samp{IPAD}
249 be aligned to a 4-byte boundary,
250 but the processor has no such requirement
251 (though it is usually good for performance).
252
253 The @code{gcc} back end needs to provide a wider array
254 of specifications of alignment requirements and preferences for targets,
255 and front ends like @code{g77} should take advantage of this
256 when it becomes available.
257
258 @cindex complex performance
259 @cindex aliasing
260 @item
261 The @code{libf2c} routines that perform some run-time
262 arithmetic on @code{COMPLEX} operands
263 were modified circa version 0.5.20 of @code{g77}
264 to work properly even in the presence of aliased operands.
265
266 While the @code{g77} and @code{netlib} versions of @code{libf2c}
267 differ on how this is accomplished,
268 the main differences are that we believe
269 the @code{g77} version works properly
270 even in the presence of @emph{partially} aliased operands.
271
272 However, these modifications have reduced performance
273 on targets such as x86,
274 due to the extra copies of operands involved.
275 @end itemize