OSDN Git Service

* bugs.texi: Various updates.
[pf3gnuchains/gcc-fork.git] / gcc / f / bugs.texi
1 @c Copyright (C) 1995-1998 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 1998-03-15
9
10 @ifclear BUGSONLY
11 @node Actual Bugs
12 @section Actual Bugs We Haven't Fixed Yet
13 @end ifclear
14
15 This section identifies bugs that @code{g77} @emph{users}
16 might run into.
17 This includes bugs that are actually in the @code{gcc}
18 back end (GBE) or in @code{libf2c}, because those
19 sets of code are at least somewhat under the control
20 of (and necessarily intertwined with) @code{g77}, so it
21 isn't worth separating them out.
22
23 For information on bugs that might afflict people who
24 configure, port, build, and install @code{g77},
25 @ref{Problems Installing}.
26
27 @itemize @bullet
28 @item
29 Something about @code{g77}'s straightforward handling of
30 label references and definitions sometimes prevents the GBE
31 from unrolling loops.
32 Until this is solved, try inserting or removing @code{CONTINUE}
33 statements as the terminal statement, using the @code{END DO}
34 form instead, and so on.
35 (Probably improved, but not wholly fixed, in 0.5.21.)
36
37 @item
38 The @code{g77} command itself should more faithfully process
39 options the way the @code{gcc} command does.
40 For example, @code{gcc} accepts abbreviated forms of long options,
41 @code{g77} generally doesn't.
42
43 @item
44 Some confusion in diagnostics concerning failing @code{INCLUDE}
45 statements from within @code{INCLUDE}'d or @code{#include}'d files.
46
47 @cindex integer constants
48 @cindex constants, integer
49 @item
50 @code{g77} assumes that @code{INTEGER(KIND=1)} constants range
51 from @samp{-2**31} to @samp{2**31-1} (the range for
52 two's-complement 32-bit values),
53 instead of determining their range from the actual range of the
54 type for the configuration (and, someday, for the constant).
55
56 Further, it generally doesn't implement the handling
57 of constants very well in that it makes assumptions about the
58 configuration that it no longer makes regarding variables (types).
59
60 Included with this item is the fact that @code{g77} doesn't recognize
61 that, on IEEE-754/854-compliant systems, @samp{0./0.} should produce a NaN
62 and no warning instead of the value @samp{0.} and a warning.
63 This is to be fixed in version 0.6, when @code{g77} will use the
64 @code{gcc} back end's constant-handling mechanisms to replace its own.
65
66 @cindex compiler speed
67 @cindex speed, of compiler
68 @cindex compiler memory usage
69 @cindex memory usage, of compiler
70 @cindex large aggregate areas
71 @cindex initialization
72 @cindex DATA statement
73 @cindex statements, DATA
74 @item
75 @code{g77} uses way too much memory and CPU time to process large aggregate
76 areas having any initialized elements.
77
78 For example, @samp{REAL A(1000000)} followed by @samp{DATA A(1)/1/}
79 takes up way too much time and space, including
80 the size of the generated assembler file.
81 This is to be mitigated somewhat in version 0.6.
82
83 Version 0.5.18 improves cases like this---specifically,
84 cases of @emph{sparse} initialization that leave large, contiguous
85 areas uninitialized---significantly.
86 However, even with the improvements, these cases still
87 require too much memory and CPU time.
88
89 (Version 0.5.18 also improves cases where the initial values are
90 zero to a much greater degree, so if the above example
91 ends with @samp{DATA A(1)/0/}, the compile-time performance
92 will be about as good as it will ever get, aside from unrelated
93 improvements to the compiler.)
94
95 Note that @code{g77} does display a warning message to
96 notify the user before the compiler appears to hang.
97 @xref{Large Initialization,,Initialization of Large Aggregate Areas},
98 for information on how to change the point at which
99 @code{g77} decides to issue this warning.
100
101 @cindex debugging
102 @cindex common blocks
103 @cindex equivalence areas
104 @cindex local equivalence areas
105 @item
106 @code{g77} doesn't emit variable and array members of common blocks for use
107 with a debugger (the @samp{-g} command-line option).
108 The code is present to do this, but doesn't work with at least
109 one debug format---perhaps it works with others.
110 And it turns out there's a similar bug for
111 local equivalence areas, so that has been disabled as well.
112
113 As of Version 0.5.19, a temporary kludge solution is provided whereby
114 some rudimentary information on a member is written as a string that
115 is the member's value as a character string.
116
117 @xref{Code Gen Options,,Options for Code Generation Conventions},
118 for information on the @samp{-fdebug-kludge} option.
119
120 @cindex code, displaying main source
121 @cindex displaying main source code
122 @cindex debugging main source code
123 @cindex printing main source
124 @item
125 When debugging, after starting up the debugger but before being able
126 to see the source code for the main program unit, the user must currently
127 set a breakpoint at @samp{MAIN__} (or @samp{MAIN___} or @samp{MAIN_} if
128 @samp{MAIN__} doesn't exist)
129 and run the program until it hits the breakpoint.
130 At that point, the
131 main program unit is activated and about to execute its first
132 executable statement, but that's the state in which the debugger should
133 start up, as is the case for languages like C.
134
135 @cindex debugger
136 @item
137 Debugging @code{g77}-compiled code using debuggers other than
138 @code{gdb} is likely not to work.
139
140 Getting @code{g77} and @code{gdb} to work together is a known
141 problem---getting @code{g77} to work properly with other
142 debuggers, for which source code often is unavailable to @code{g77}
143 developers, seems like a much larger, unknown problem,
144 and is a lower priority than making @code{g77} and @code{gdb}
145 work together properly.
146
147 On the other hand, information about problems other debuggers
148 have with @code{g77} output might make it easier to properly
149 fix @code{g77}, and perhaps even improve @code{gdb}, so it
150 is definitely welcome.
151 Such information might even lead to all relevant products
152 working together properly sooner.
153
154 @cindex padding
155 @cindex structures
156 @cindex common blocks
157 @cindex equivalence areas
158 @item
159 @code{g77} currently inserts needless padding for things like
160 @samp{COMMON A,IPAD} where @samp{A} is @code{CHARACTER*1} and @samp{IPAD}
161 is @code{INTEGER(KIND=1)} on machines like x86, because
162 the back end insists that @samp{IPAD} be aligned to a 4-byte boundary, but
163 the processor has no such requirement (though it's good for
164 performance).
165
166 It is possible that this is not a real bug, and could be considered
167 a performance feature, but it might be important to provide
168 the ability to Fortran code to specify minimum padding for
169 aggregate areas such as common blocks---and, certainly, there
170 is the potential, with the current setup, for interface differences
171 in the way such areas are laid out between @code{g77} and other
172 compilers.
173
174 @cindex Alpha, support
175 @cindex support, Alpha
176 @item
177 @code{g77} doesn't work perfectly on 64-bit configurations such as the Alpha.
178 This problem is expected to be largely resolved as of version 0.5.20,
179 and further addressed by 0.5.21.
180 Version 0.6 should solve most or all related problems (such as
181 64-bit machines other than Digital Semiconductor (``DEC'') Alphas).
182
183 One known bug that causes a compile-time crash occurs when compiling
184 code such as the following with optimization:
185
186 @example
187 SUBROUTINE CRASH (TEMP)
188 INTEGER*2 HALF(2)
189 REAL TEMP
190 HALF(1) = NINT (TEMP)
191 END
192 @end example
193
194 It is expected that a future version of @code{g77} will have a fix for this
195 problem, almost certainly by the time @code{g77} supports the forthcoming
196 version 2.8.0 of @code{gcc}.
197
198 @cindex COMPLEX support
199 @cindex support, COMPLEX
200 @item
201 Maintainers of gcc report that the back end definitely has ``broken''
202 support for @code{COMPLEX} types.
203 Based on their input, it seems many of
204 the problems affect only the more-general facilities for gcc's
205 @code{__complex__} type, such as @code{__complex__ int}
206 (where the real and imaginary parts are integers) that GNU
207 Fortran does not use.
208
209 Version 0.5.20 of @code{g77} works around this
210 problem by not using the back end's support for @code{COMPLEX}.
211 The new option @samp{-fno-emulate-complex} avoids the work-around,
212 reverting to using the same ``broken'' mechanism as that used
213 by versions of @code{g77} prior to 0.5.20.
214 @end itemize