home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / g77doc.zip / bugs.tex next >
Text File  |  1998-03-15  |  9KB  |  245 lines

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