home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / OPENSTEP / UNIX / GNU / gcc-2.7.2.3.1-I / info / g77.info-16 < prev    next >
Encoding:
GNU Info File  |  1997-09-12  |  50.4 KB  |  1,211 lines

  1. This is Info file g77.info, produced by Makeinfo version 1.68 from the
  2. input file g77.texi.
  3.  
  4.    This file explains how to use the GNU Fortran system.
  5.  
  6.    Published by the Free Software Foundation 59 Temple Place - Suite 330
  7. Boston, MA 02111-1307 USA
  8.  
  9.    Copyright (C) 1995-1997 Free Software Foundation, Inc.
  10.  
  11.    Permission is granted to make and distribute verbatim copies of this
  12. manual provided the copyright notice and this permission notice are
  13. preserved on all copies.
  14.  
  15.    Permission is granted to copy and distribute modified versions of
  16. this manual under the conditions for verbatim copying, provided also
  17. that the sections entitled "GNU General Public License," "Funding for
  18. Free Software," and "Protect Your Freedom--Fight `Look And Feel'" are
  19. included exactly as in the original, and provided that the entire
  20. resulting derived work is distributed under the terms of a permission
  21. notice identical to this one.
  22.  
  23.    Permission is granted to copy and distribute translations of this
  24. manual into another language, under the above conditions for modified
  25. versions, except that the sections entitled "GNU General Public
  26. License," "Funding for Free Software," and "Protect Your Freedom--Fight
  27. `Look And Feel'", and this permission notice, may be included in
  28. translations approved by the Free Software Foundation instead of in the
  29. original English.
  30.  
  31.    Contributed by James Craig Burley (<burley@gnu.ai.mit.edu>).
  32. Inspired by a first pass at translating `g77-0.5.16/f/DOC' that was
  33. contributed to Craig by David Ronis (<ronis@onsager.chem.mcgill.ca>).
  34.  
  35. INFO-DIR-SECTION Fortran Programming
  36. START-INFO-DIR-ENTRY
  37. * g77: (g77).               The GNU Fortran compilation system.
  38. END-INFO-DIR-ENTRY
  39.  
  40. 
  41. File: g77.info,  Node: But-bugs,  Next: Actual Bugs,  Up: Trouble
  42.  
  43. Bugs Not In GNU Fortran
  44. =======================
  45.  
  46.    These are bugs to which the maintainers often have to reply, "but
  47. that isn't a bug in `g77'...".  Some of these already are fixed in new
  48. versions of other software; some still need to be fixed; some are
  49. problems with how `g77' is installed or is being used; some are the
  50. result of bad hardware that causes software to misbehave in sometimes
  51. bizarre ways; some just cannot be addressed at this time until more is
  52. known about the problem.
  53.  
  54.    Please don't re-report these bugs to the `g77' maintainers--if you
  55. must remind someone how important it is to you that the problem be
  56. fixed, talk to the people responsible for the other products identified
  57. below, but preferably only after you've tried the latest versions of
  58. those products.  The `g77' maintainers have their hands full working on
  59. just fixing and improving `g77', without serving as a clearinghouse for
  60. all bugs that happen to affect `g77' users.
  61.  
  62.    *Note Collected Fortran Wisdom::, for information on behavior of
  63. Fortran programs, and the programs that compile them, that might be
  64. *thought* to indicate bugs.
  65.  
  66. * Menu:
  67.  
  68. * Signal 11 and Friends::  Strange behavior by any software.
  69. * Cannot Link Fortran Programs::  Unresolved references.
  70. * Large Common Blocks::    Problems on older GNU/Linux systems.
  71. * Debugger Problems::      When the debugger crashes.
  72. * NeXTStep Problems::      Misbehaving executables.
  73. * Stack Overflow::         More misbehaving executables.
  74. * Nothing Happens::        Less behaving executables.
  75. * Strange Behavior at Run Time::  Executables misbehaving due to
  76.                             bugs in your program.
  77. * Floating-point Errors::  The results look wrong, but....
  78.  
  79. 
  80. File: g77.info,  Node: Signal 11 and Friends,  Next: Cannot Link Fortran Programs,  Up: But-bugs
  81.  
  82. Signal 11 and Friends
  83. ---------------------
  84.  
  85.    A whole variety of strange behaviors can occur when the software, or
  86. the way you are using the software, stresses the hardware in a way that
  87. triggers hardware bugs.  This might seem hard to believe, but it
  88. happens frequently enough that there exist documents explaining in
  89. detail what the various causes of the problems are, what typical
  90. symptoms look like, and so on.
  91.  
  92.    Generally these problems are referred to in this document as "signal
  93. 11" crashes, because the Linux kernel, running on the most popular
  94. hardware (the Intel x86 line), often stresses the hardware more than
  95. other popular operating systems.  When hardware problems do occur under
  96. GNU/Linux on x86 systems, these often manifest themselves as "signal 11"
  97. problems, as illustrated by the following diagnostic:
  98.  
  99.      sh# g77 myprog.f
  100.      gcc: Internal compiler error: program f771 got fatal signal 11
  101.      sh#
  102.  
  103.    It is *very* important to remember that the above message is *not*
  104. the only one that indicates a hardware problem, nor does it always
  105. indicate a hardware problem.
  106.  
  107.    In particular, on systems other than those running the Linux kernel,
  108. the message might appear somewhat or very different, as it will if the
  109. error manifests itself while running a program other than the `g77'
  110. compiler.  For example, it will appear somewhat different when running
  111. your program, when running Emacs, and so on.
  112.  
  113.    How to cope with such problems is well beyond the scope of this
  114. manual.
  115.  
  116.    However, users of Linux-based systems (such as GNU/Linux) should
  117. review `http://www.bitwizard.nl/sig11', a source of detailed
  118. information on diagnosing hardware problems, by recognizing their
  119. common symptoms.
  120.  
  121.    Users of other operating systems and hardware might find this
  122. reference useful as well.  If you know of similar material for another
  123. hardware/software combination, please let us know so we can consider
  124. including a reference to it in future versions of this manual.
  125.  
  126. 
  127. File: g77.info,  Node: Cannot Link Fortran Programs,  Next: Large Common Blocks,  Prev: Signal 11 and Friends,  Up: But-bugs
  128.  
  129. Cannot Link Fortran Programs
  130. ----------------------------
  131.  
  132.    On some systems, perhaps just those with out-of-date (shared?)
  133. libraries, unresolved-reference errors happen when linking
  134. `g77'-compiled programs (which should be done using `g77').
  135.  
  136.    If this happens to you, try appending `-lc' to the command you use
  137. to link the program, e.g. `g77 foo.f -lc'.  `g77' already specifies
  138. `-lf2c -lm' when it calls the linker, but it cannot also specify `-lc'
  139. because not all systems have a file named `libc.a'.
  140.  
  141.    It is unclear at this point whether there are legitimately installed
  142. systems where `-lf2c -lm' is insufficient to resolve code produced by
  143. `g77'.
  144.  
  145.    If your program doesn't link due to unresolved references to names
  146. like `_main', make sure you're using the `g77' command to do the link,
  147. since this command ensures that the necessary libraries are loaded by
  148. specifying `-lf2c -lm' when it invokes the `gcc' command to do the
  149. actual link.  (Use the `-v' option to discover more about what actually
  150. happens when you use the `g77' and `gcc' commands.)
  151.  
  152.    Also, try specifying `-lc' as the last item on the `g77' command
  153. line, in case that helps.
  154.  
  155. 
  156. File: g77.info,  Node: Large Common Blocks,  Next: Debugger Problems,  Prev: Cannot Link Fortran Programs,  Up: But-bugs
  157.  
  158. Large Common Blocks
  159. -------------------
  160.  
  161.    On some older GNU/Linux systems, programs with common blocks larger
  162. than 16MB cannot be linked without some kind of error message being
  163. produced.
  164.  
  165.    This is a bug in older versions of `ld', fixed in more recent
  166. versions of `binutils', such as version 2.6.
  167.  
  168. 
  169. File: g77.info,  Node: Debugger Problems,  Next: NeXTStep Problems,  Prev: Large Common Blocks,  Up: But-bugs
  170.  
  171. Debugger Problems
  172. -----------------
  173.  
  174.    There are some known problems when using `gdb' on code compiled by
  175. `g77'.  Inadequate investigation as of the release of 0.5.16 results in
  176. not knowing which products are the culprit, but `gdb-4.14' definitely
  177. crashes when, for example, an attempt is made to print the contents of
  178. a `COMPLEX(KIND=2)' dummy array, on at least some GNU/Linux machines,
  179. plus some others.
  180.  
  181. 
  182. File: g77.info,  Node: NeXTStep Problems,  Next: Stack Overflow,  Prev: Debugger Problems,  Up: But-bugs
  183.  
  184. NeXTStep Problems
  185. -----------------
  186.  
  187.    Developers of Fortran code on NeXTStep (all architectures) have to
  188. watch out for the following problem when writing programs with large,
  189. statically allocated (i.e. non-stack based) data structures (common
  190. blocks, saved arrays).
  191.  
  192.    Due to the way the native loader (`/bin/ld') lays out data
  193. structures in virtual memory, it is very easy to create an executable
  194. wherein the `__DATA' segment overlaps (has addresses in common) with
  195. the `UNIX STACK' segment.
  196.  
  197.    This leads to all sorts of trouble, from the executable simply not
  198. executing, to bus errors.  The NeXTStep command line tool `ebadexec'
  199. points to the problem as follows:
  200.  
  201.      % /bin/ebadexec a.out
  202.      /bin/ebadexec: __LINKEDIT segment (truncated address = 0x3de000
  203.      rounded size = 0x2a000) of executable file: a.out overlaps with UNIX
  204.      STACK segment (truncated address = 0x400000 rounded size =
  205.      0x3c00000) of executable file: a.out
  206.  
  207.    (In the above case, it is the `__LINKEDIT' segment that overlaps the
  208. stack segment.)
  209.  
  210.    This can be cured by assigning the `__DATA' segment (virtual)
  211. addresses beyond the stack segment.  A conservative estimate for this
  212. is from address 6000000 (hexadecimal) onwards--this has always worked
  213. for me [Toon Moene]:
  214.  
  215.      % g77 -segaddr __DATA 6000000 test.f
  216.      % ebadexec a.out
  217.      ebadexec: file: a.out appears to be executable
  218.      %
  219.  
  220.    Browsing through `gcc/f/Makefile.in', you will find that the `f771'
  221. program itself also has to be linked with these flags--it has large
  222. statically allocated data structures.  (Version 0.5.18 reduces this
  223. somewhat, but probably not enough.)
  224.  
  225.    (The above item was contributed by Toon Moene
  226. (<toon@moene.indiv.nluug.nl>).)
  227.  
  228. 
  229. File: g77.info,  Node: Stack Overflow,  Next: Nothing Happens,  Prev: NeXTStep Problems,  Up: But-bugs
  230.  
  231. Stack Overflow
  232. --------------
  233.  
  234.    `g77' code might fail at runtime (probably with a "segmentation
  235. violation") due to overflowing the stack.  This happens most often on
  236. systems with an environment that provides substantially more heap space
  237. (for use when arbitrarily allocating and freeing memory) than stack
  238. space.
  239.  
  240.    Often this can be cured by increasing or removing your shell's limit
  241. on stack usage, typically using `limit stacksize' (in `csh' and
  242. derivatives) or `ulimit -s' (in `sh' and derivatives).
  243.  
  244.    Increasing the allowed stack size might, however, require changing
  245. some operating system or system configuration parameters.
  246.  
  247.    You might be able to work around the problem by compiling with the
  248. `-fno-automatic' option to reduce stack usage, probably at the expense
  249. of speed.
  250.  
  251.    *Note Maximum Stackable Size::, for information on patching `g77' to
  252. use different criteria for placing local non-automatic variables and
  253. arrays on the stack.
  254.  
  255.    However, if your program uses large automatic arrays (for example,
  256. has declarations like `REAL A(N)' where `A' is a local array and `N' is
  257. a dummy or `COMMON' variable that can have a large value), neither use
  258. of `-fno-automatic', nor changing the cut-off point for `g77' for using
  259. the stack, will solve the problem by changing the placement of these
  260. large arrays, as they are *necessarily* automatic.
  261.  
  262.    `g77' currently provides no means to specify that automatic arrays
  263. are to be allocated on the heap instead of the stack.  So, other than
  264. increasing the stack size, your best bet is to change your source code
  265. to avoid large automatic arrays.  Methods for doing this currently are
  266. outside the scope of this document.
  267.  
  268.    (*Note:* If your system puts stack and heap space in the same memory
  269. area, such that they are effectively combined, then a stack overflow
  270. probably indicates a program that is either simply too large for the
  271. system, or buggy.)
  272.  
  273. 
  274. File: g77.info,  Node: Nothing Happens,  Next: Strange Behavior at Run Time,  Prev: Stack Overflow,  Up: But-bugs
  275.  
  276. Nothing Happens
  277. ---------------
  278.  
  279.    It is occasionally reported that a "simple" program, such as a
  280. "Hello, World!" program, does nothing when it is run, even though the
  281. compiler reported no errors, despite the program containing nothing
  282. other than a simple `PRINT' statement.
  283.  
  284.    This most often happens because the program has been compiled and
  285. linked on a UNIX system and named `test', though other names can lead
  286. to similarly unexpected run-time behavior on various systems.
  287.  
  288.    Essentially this problem boils down to giving your program a name
  289. that is already known to the shell you are using to identify some other
  290. program, which the shell continues to execute instead of your program
  291. when you invoke it via, for example:
  292.  
  293.      sh# test
  294.      sh#
  295.  
  296.    Under UNIX and many other system, a simple command name invokes a
  297. searching mechanism that might well not choose the program located in
  298. the current working directory if there is another alternative (such as
  299. the `test' command commonly installed on UNIX systems).
  300.  
  301.    The reliable way to invoke a program you just linked in the current
  302. directory under UNIX is to specify it using an explicit pathname, as in:
  303.  
  304.      sh# ./test
  305.       Hello, World!
  306.      sh#
  307.  
  308.    Users who encounter this problem should take the time to read up on
  309. how their shell searches for commands, how to set their search path,
  310. and so on.  The relevant UNIX commands to learn about include `man',
  311. `info' (on GNU systems), `setenv' (or `set' and `env'), `which', and
  312. `find'.
  313.  
  314. 
  315. File: g77.info,  Node: Strange Behavior at Run Time,  Next: Floating-point Errors,  Prev: Nothing Happens,  Up: But-bugs
  316.  
  317. Strange Behavior at Run Time
  318. ----------------------------
  319.  
  320.    `g77' code might fail at runtime with "segmentation violation", "bus
  321. error", or even something as subtle as a procedure call overwriting a
  322. variable or array element that it is not supposed to touch.
  323.  
  324.    These can be symptoms of a wide variety of actual bugs that occurred
  325. earlier during the program's run, but manifested themselves as
  326. *visible* problems some time later.
  327.  
  328.    Overflowing the bounds of an array--usually by writing beyond the
  329. end of it--is one of two kinds of bug that often occurs in Fortran code.
  330.  
  331.    The other kind of bug is a mismatch between the actual arguments
  332. passed to a procedure and the dummy arguments as declared by that
  333. procedure.
  334.  
  335.    Both of these kinds of bugs, and some others as well, can be
  336. difficult to track down, because the bug can change its behavior, or
  337. even appear to not occur, when using a debugger.
  338.  
  339.    That is, these bugs can be quite sensitive to data, including data
  340. representing the placement of other data in memory (that is, pointers,
  341. such as the placement of stack frames in memory).
  342.  
  343.    Plans call for improving `g77' so that it can offer the ability to
  344. catch and report some of these problems at compile, link, or run time,
  345. such as by generating code to detect references to beyond the bounds of
  346. an array, or checking for agreement between calling and called
  347. procedures.
  348.  
  349.    In the meantime, finding and fixing the programming bugs that lead
  350. to these behaviors is, ultimately, the user's responsibility, as
  351. difficult as that task can sometimes be.
  352.  
  353.    One runtime problem that has been observed might have a simple
  354. solution.  If a formatted `WRITE' produces an endless stream of spaces,
  355. check that your program is linked against the correct version of the C
  356. library.  The configuration process takes care to account for your
  357. system's normal `libc' not being ANSI-standard, which will otherwise
  358. cause this behaviour.  If your system's default library is
  359. ANSI-standard and you subsequently link against a non-ANSI one, there
  360. might be problems such as this one.
  361.  
  362.    Specifically, on Solaris2 systems, avoid picking up the `BSD'
  363. library from `/usr/ucblib'.
  364.  
  365. 
  366. File: g77.info,  Node: Floating-point Errors,  Prev: Strange Behavior at Run Time,  Up: But-bugs
  367.  
  368. Floating-point Errors
  369. ---------------------
  370.  
  371.    Some programs appear to produce inconsistent floating-point results
  372. compiled by `g77' versus by other compilers.
  373.  
  374.    Often the reason for this behavior is the fact that floating-point
  375. values are represented on almost all Fortran systems by
  376. *approximations*, and these approximations are inexact even for
  377. apparently simple values like 0.1, 0.2, 0.3, 0.4, 0.6, 0.7, 0.8, 0.9,
  378. 1.1, and so on.  Most Fortran systems, including all current ports of
  379. `g77', use binary arithmetic to represent these approximations.
  380.  
  381.    Therefore, the exact value of any floating-point approximation as
  382. manipulated by `g77'-compiled code is representable by adding some
  383. combination of the values 1.0, 0.5, 0.25, 0.125, and so on (just keep
  384. dividing by two) through the precision of the fraction (typically
  385. around 23 bits for `REAL(KIND=1)', 52 for `REAL(KIND=2)'), then
  386. multiplying the sum by a integral power of two (in Fortran, by `2**N')
  387. that typically is between -127 and +128 for `REAL(KIND=1)' and -1023
  388. and +1024 for `REAL(KIND=2)', then multiplying by -1 if the number is
  389. negative.
  390.  
  391.    So, a value like 0.2 is exactly represented in decimal--since it is
  392. a fraction, `2/10', with a denomenator that is compatible with the base
  393. of the number system (base 10).  However, `2/10' cannot be represented
  394. by any finite number of sums of any of 1.0, 0.5, 0.25, and so on, so
  395. 0.2 cannot be exactly represented in binary notation.
  396.  
  397.    (On the other hand, decimal notation can represent any binary number
  398. in a finite number of digits.  Decimal notation cannot do so with
  399. ternary, or base-3, notation, which would represent floating-point
  400. numbers as sums of any of `1/1', `1/3', `1/9', and so on.  After all,
  401. no finite number of decimal digits can exactly represent `1/3'.
  402. Fortunately, few systems use ternary notation.)
  403.  
  404.    Moreover, differences in the way run-time I/O libraries convert
  405. between these approximations and the decimal representation often used
  406. by programmers and the programs they write can result in apparent
  407. differences between results that do not actually exist, or exist to
  408. such a small degree that they usually are not worth worrying about.
  409.  
  410.    For example, consider the following program:
  411.  
  412.      PRINT *, 0.2
  413.      END
  414.  
  415.    When compiled by `g77', the above program might output `0.20000003',
  416. while another compiler might produce a executable that outputs `0.2'.
  417.  
  418.    This particular difference is due to the fact that, currently,
  419. conversion of floating-point values by the `libf2c' library, used by
  420. `g77', handles only double-precision values.
  421.  
  422.    Since `0.2' in the program is a single-precision value, it is
  423. converted to double precision (still in binary notation) before being
  424. converted back to decimal.  The conversion to binary appends _binary_
  425. zero digits to the original value--which, again, is an inexact
  426. approximation of 0.2--resulting in an approximation that is much less
  427. exact than is connoted by the use of double precision.
  428.  
  429.    (The appending of binary zero digits has essentially the same effect
  430. as taking a particular decimal approximation of `1/3', such as
  431. `0.3333333', and appending decimal zeros to it, producing
  432. `0.33333330000000000'.  Treating the resulting decimal approximation as
  433. if it really had 18 or so digits of valid precision would make it seem
  434. a very poor approximation of `1/3'.)
  435.  
  436.    As a result of converting the single-precision approximation to
  437. double precision by appending binary zeros, the conversion of the
  438. resulting double-precision value to decimal produces what looks like an
  439. incorrect result, when in fact the result is *inexact*, and is probably
  440. no less inaccurate or imprecise an approximation of 0.2 than is
  441. produced by other compilers that happen to output the converted value
  442. as "exactly" `0.2'.  (Some compilers behave in a way that can make them
  443. appear to retain more accuracy across a conversion of a single-precision
  444. constant to double precision.  *Note Context-Sensitive Constants::, to
  445. see why this practice is illusory and even dangerous.)
  446.  
  447.    Note that a more exact approximation of the constant is computed
  448. when the program is changed to specify a double-precision constant:
  449.  
  450.      PRINT *, 0.2D0
  451.      END
  452.  
  453.    Future versions of `g77' and/or `libf2c' might convert
  454. single-precision values directly to decimal, instead of converting them
  455. to double precision first.  This would tend to result in output that is
  456. more consistent with that produced by some other Fortran
  457. implementations.
  458.  
  459. 
  460. File: g77.info,  Node: Actual Bugs,  Next: Missing Features,  Prev: But-bugs,  Up: Trouble
  461.  
  462. Actual Bugs We Haven't Fixed Yet
  463. ================================
  464.  
  465.    This section identifies bugs that `g77' *users* might run into.
  466. This includes bugs that are actually in the `gcc' back end (GBE) or in
  467. `libf2c', because those sets of code are at least somewhat under the
  468. control of (and necessarily intertwined with) `g77', so it isn't worth
  469. separating them out.
  470.  
  471.    For information on bugs that might afflict people who configure,
  472. port, build, and install `g77', *Note Problems Installing::.
  473.  
  474.    * `g77''s version of `gcc', and probably `g77' itself, cannot be
  475.      reliably used with the `-O2' option (or higher) on Digital
  476.      Semiconductor Alpha AXP machines.  The problem is most immediately
  477.      noticed in differences discovered by `make compare' following a
  478.      bootstrap build using `-O2'.  It also manifests itself as a
  479.      failure to compile `DATA' statements such as `DATA R/7./'
  480.      correctly; in this case, `R' might be initialized to `4.0'.
  481.  
  482.      Until this bug is fixed, use only `-O1' or no optimization.
  483.  
  484.    * A code-generation bug afflicts Intel x86 targets when `-O2' is
  485.      specified compiling, for example, an old version of the `DNRM2'
  486.      routine.  The x87 coprocessor stack is being somewhat mismanaged
  487.      in cases where assigned `GOTO' and `ASSIGN' are involved.
  488.  
  489.      Version 0.5.21 of `g77' contains an initial effort to fix the
  490.      problem, but this effort is incomplete, and a more complete fix is
  491.      planned for the next release.
  492.  
  493.    * Work is needed on the `SIGNAL()' intrinsic to ensure that pointers
  494.      and integers are properly handled on all targets, including 64-bit
  495.      machines.
  496.  
  497.    * When using `-fugly-comma', `g77' assumes an extra `%VAL(0)'
  498.      argument is to be passed to intrinsics taking no arguments, such
  499.      as `IARGC()', which in turn reject such a call.  Although this has
  500.      been worked around for 0.5.18 due to changes in the handling of
  501.      intrinsics, `g77' needs to do the ugly-argument-appending trick
  502.      only for external-function invocation, as this would probably be
  503.      more consistent with compilers that default to using that trick.
  504.  
  505.    * Something about `g77''s straightforward handling of label
  506.      references and definitions sometimes prevents the GBE from
  507.      unrolling loops.  Until this is solved, try inserting or removing
  508.      `CONTINUE' statements as the terminal statement, using the `END DO'
  509.      form instead, and so on.  (Probably improved, but not wholly
  510.      fixed, in 0.5.21.)
  511.  
  512.    * The `g77' command itself should more faithfully process options
  513.      the way the `gcc' command does.  For example, `gcc' accepts
  514.      abbreviated forms of long options, `g77' generally doesn't.
  515.  
  516.    * Some confusion in diagnostics concerning failing `INCLUDE'
  517.      statements from within `INCLUDE''d or `#include''d files.
  518.  
  519.    * `g77' assumes that `INTEGER(KIND=1)' constants range from `-2**31'
  520.      to `2**31-1' (the range for two's-complement 32-bit values),
  521.      instead of determining their range from the actual range of the
  522.      type for the configuration (and, someday, for the constant).
  523.  
  524.      Further, it generally doesn't implement the handling of constants
  525.      very well in that it makes assumptions about the configuration
  526.      that it no longer makes regarding variables (types).
  527.  
  528.      Included with this item is the fact that `g77' doesn't recognize
  529.      that, on IEEE-754/854-compliant systems, `0./0.' should produce a
  530.      NaN and no warning instead of the value `0.' and a warning.  This
  531.      is to be fixed in version 0.6, when `g77' will use the `gcc' back
  532.      end's constant-handling mechanisms to replace its own.
  533.  
  534.    * `g77' uses way too much memory and CPU time to process large
  535.      aggregate areas having any initialized elements.
  536.  
  537.      For example, `REAL A(1000000)' followed by `DATA A(1)/1/' takes up
  538.      way too much time and space, including the size of the generated
  539.      assembler file.  This is to be mitigated somewhat in version 0.6.
  540.  
  541.      Version 0.5.18 improves cases like this--specifically, cases of
  542.      *sparse* initialization that leave large, contiguous areas
  543.      uninitialized--significantly.  However, even with the
  544.      improvements, these cases still require too much memory and CPU
  545.      time.
  546.  
  547.      (Version 0.5.18 also improves cases where the initial values are
  548.      zero to a much greater degree, so if the above example ends with
  549.      `DATA A(1)/0/', the compile-time performance will be about as good
  550.      as it will ever get, aside from unrelated improvements to the
  551.      compiler.)
  552.  
  553.      Note that `g77' does display a warning message to notify the user
  554.      before the compiler appears to hang.  *Note Initialization of
  555.      Large Aggregate Areas: Large Initialization, for information on
  556.      how to change the point at which `g77' decides to issue this
  557.      warning.
  558.  
  559.    * `g77' doesn't emit variable and array members of common blocks for
  560.      use with a debugger (the `-g' command-line option).  The code is
  561.      present to do this, but doesn't work with at least one debug
  562.      format--perhaps it works with others.  And it turns out there's a
  563.      similar bug for local equivalence areas, so that has been disabled
  564.      as well.
  565.  
  566.      As of Version 0.5.19, a temporary kludge solution is provided
  567.      whereby some rudimentary information on a member is written as a
  568.      string that is the member's value as a character string.
  569.  
  570.      *Note Options for Code Generation Conventions: Code Gen Options,
  571.      for information on the `-fdebug-kludge' option.
  572.  
  573.    * When debugging, after starting up the debugger but before being
  574.      able to see the source code for the main program unit, the user
  575.      must currently set a breakpoint at `MAIN__' (or `MAIN___' or
  576.      `MAIN_' if `MAIN__' doesn't exist) and run the program until it
  577.      hits the breakpoint.  At that point, the main program unit is
  578.      activated and about to execute its first executable statement, but
  579.      that's the state in which the debugger should start up, as is the
  580.      case for languages like C.
  581.  
  582.    * Debugging `g77'-compiled code using debuggers other than `gdb' is
  583.      likely not to work.
  584.  
  585.      Getting `g77' and `gdb' to work together is a known
  586.      problem--getting `g77' to work properly with other debuggers, for
  587.      which source code often is unavailable to `g77' developers, seems
  588.      like a much larger, unknown problem, and is a lower priority than
  589.      making `g77' and `gdb' work together properly.
  590.  
  591.      On the other hand, information about problems other debuggers have
  592.      with `g77' output might make it easier to properly fix `g77', and
  593.      perhaps even improve `gdb', so it is definitely welcome.  Such
  594.      information might even lead to all relevant products working
  595.      together properly sooner.
  596.  
  597.    * `g77' currently inserts needless padding for things like `COMMON
  598.      A,IPAD' where `A' is `CHARACTER*1' and `IPAD' is `INTEGER(KIND=1)'
  599.      on machines like x86, because the back end insists that `IPAD' be
  600.      aligned to a 4-byte boundary, but the processor has no such
  601.      requirement (though it's good for performance).
  602.  
  603.      It is possible that this is not a real bug, and could be considered
  604.      a performance feature, but it might be important to provide the
  605.      ability to Fortran code to specify minimum padding for aggregate
  606.      areas such as common blocks--and, certainly, there is the
  607.      potential, with the current setup, for interface differences in
  608.      the way such areas are laid out between `g77' and other compilers.
  609.  
  610.    * Some crashes occur when compiling under Solaris on x86 machines.
  611.  
  612.      Nothing has been heard about any such problems for some time, so
  613.      this is considering a closed item as of 0.5.20.  Please submit any
  614.      bug reports pertinent to `g77''s support for Solaris/x86 systems.
  615.  
  616.    * RS/6000 support is not complete as of the gcc 2.6.3 back end.  The
  617.      2.7.0 back end appears to fix this problem, or at least mitigate
  618.      it significantly, but there is at least one known problem that is
  619.      likely to be a code-generation bug in `gcc-2.7.0' plus
  620.      `g77-0.5.16'.  This problem shows up only when compiling the
  621.      Fortran program with `-O'.
  622.  
  623.      Nothing has been heard about any RS/6000 problems for some time,
  624.      so this is considering a closed item as of 0.5.20.  Please submit
  625.      any bug reports pertinent to `g77''s support for RS/6000 systems.
  626.  
  627.    * SGI support is known to be a bit buggy.  The known problem shows
  628.      up only when compiling the Fortran program with `-O'.
  629.  
  630.      It is possible these problems have all been fixed in 0.5.20 by
  631.      emulating complex arithmetic in the front end.  Please submit any
  632.      bug reports pertinent to `g77''s support for SGI systems.
  633.  
  634.    * `g77' doesn't work perfectly on 64-bit configurations such as the
  635.      Alpha.  This problem is expected to be largely resolved as of
  636.      version 0.5.20, and further addressed by 0.5.21.  Version 0.6
  637.      should solve most or all related problems (such as 64-bit machines
  638.      other than Digital Semiconductor ("DEC") Alphas).
  639.  
  640.      One known bug that causes a compile-time crash occurs when
  641.      compiling code such as the following with optimization:
  642.  
  643.           SUBROUTINE CRASH (TEMP)
  644.           INTEGER*2 HALF(2)
  645.           REAL TEMP
  646.           HALF(1) = NINT (TEMP)
  647.           END
  648.  
  649.      It is expected that a future version of `g77' will have a fix for
  650.      this problem, almost certainly by the time `g77' supports the
  651.      forthcoming version 2.8.0 of `gcc'.
  652.  
  653.    * Maintainers of gcc report that the back end definitely has "broken"
  654.      support for `COMPLEX' types.  Based on their input, it seems many
  655.      of the problems affect only the more-general facilities for gcc's
  656.      `__complex__' type, such as `__complex__ int' (where the real and
  657.      imaginary parts are integers) that GNU Fortran does not use.
  658.  
  659.      Version 0.5.20 of `g77' works around this problem by not using the
  660.      back end's support for `COMPLEX'.  The new option
  661.      `-fno-emulate-complex' avoids the work-around, reverting to using
  662.      the same "broken" mechanism as that used by versions of `g77'
  663.      prior to 0.5.20.
  664.  
  665.    * There seem to be some problems with passing constants, and perhaps
  666.      general expressions (other than simple variables/arrays), to
  667.      procedures when compiling on some systems (such as i386) with
  668.      `-fPIC', as in when compiling for ELF targets.  The symptom is
  669.      that the assembler complains about invalid opcodes.  More
  670.      investigation is needed, but the problem is almost certainly in
  671.      the gcc back end, and it apparently occurs only when compiling
  672.      sufficiently complicated functions *without* the `-O' option.
  673.  
  674. 
  675. File: g77.info,  Node: Missing Features,  Next: Disappointments,  Prev: Actual Bugs,  Up: Trouble
  676.  
  677. Missing Features
  678. ================
  679.  
  680.    This section lists features we know are missing from `g77', and
  681. which we want to add someday.  (There is no priority implied in the
  682. ordering below.)
  683.  
  684. * Menu:
  685.  
  686. GNU Fortran language:
  687. * Better Source Model::
  688. * Fortran 90 Support::
  689. * Intrinsics in PARAMETER Statements::
  690. * SELECT CASE on CHARACTER Type::
  691. * RECURSIVE Keyword::
  692. * Popular Non-standard Types::
  693. * Full Support for Compiler Types::
  694. * Array Bounds Expressions::
  695. * POINTER Statements::
  696. * Sensible Non-standard Constructs::
  697. * FLUSH Statement::
  698. * Expressions in FORMAT Statements::
  699. * Explicit Assembler Code::
  700. * Q Edit Descriptor::
  701.  
  702. GNU Fortran dialects:
  703. * Old-style PARAMETER Statements::
  704. * TYPE and ACCEPT I/O Statements::
  705. * STRUCTURE UNION RECORD MAP::
  706. * OPEN CLOSE and INQUIRE Keywords::
  707. * ENCODE and DECODE::
  708. * Suppressing Space Padding::
  709. * Fortran Preprocessor::
  710. * Bit Operations on Floating-point Data::
  711.  
  712. New facilities:
  713. * POSIX Standard::
  714. * Floating-point Exception Handling::
  715. * Nonportable Conversions::
  716. * Large Automatic Arrays::
  717. * Support for Threads::
  718. * Increasing Precision/Range::
  719.  
  720. Better diagnostics:
  721. * Gracefully Handle Sensible Bad Code::
  722. * Non-standard Conversions::
  723. * Non-standard Intrinsics::
  724. * Modifying DO Variable::
  725. * Better Pedantic Compilation::
  726. * Warn About Implicit Conversions::
  727. * Invalid Use of Hollerith Constant::
  728. * Dummy Array Without Dimensioning Dummy::
  729. * Invalid FORMAT Specifiers::
  730. * Ambiguous Dialects::
  731. * Unused Labels::
  732. * Informational Messages::
  733.  
  734. Run-time facilities:
  735. * Uninitialized Variables at Run Time::
  736. * Bounds Checking at Run Time::
  737.  
  738. Debugging:
  739. * Labels Visible to Debugger::
  740.  
  741. 
  742. File: g77.info,  Node: Better Source Model,  Next: Fortran 90 Support,  Up: Missing Features
  743.  
  744. Better Source Model
  745. -------------------
  746.  
  747.    `g77' needs to provide, as the default source-line model, a "pure
  748. visual" mode, where the interpretation of a source program in this mode
  749. can be accurately determined by a user looking at a traditionally
  750. displayed rendition of the program (assuming the user knows whether the
  751. program is fixed or free form).
  752.  
  753.    The design should assume the user cannot tell tabs from spaces and
  754. cannot see trailing spaces on lines, but has canonical tab stops and,
  755. for fixed-form source, has the ability to always know exactly where
  756. column 72 is (since the Fortran standard itself requires this for
  757. fixed-form source).
  758.  
  759.    This would change the default treatment of fixed-form source to not
  760. treat lines with tabs as if they were infinitely long--instead, they
  761. would end at column 72 just as if the tabs were replaced by spaces in
  762. the canonical way.
  763.  
  764.    As part of this, provide common alternate models (Digital, `f2c',
  765. and so on) via command-line options.  This includes allowing
  766. arbitrarily long lines for free-form source as well as fixed-form
  767. source and providing various limits and diagnostics as appropriate.
  768.  
  769.    Also, `g77' should offer, perhaps even default to, warnings when
  770. characters beyond the last valid column are anything other than spaces.
  771. This would mean code with "sequence numbers" in columns 73 through 80
  772. would be rejected, and there's a lot of that kind of code around, but
  773. one of the most frequent bugs encountered by new users is accidentally
  774. writing fixed-form source code into and beyond column 73.  So, maybe
  775. the users of old code would be able to more easily handle having to
  776. specify, say, a `-Wno-col73to80' option.
  777.  
  778. 
  779. File: g77.info,  Node: Fortran 90 Support,  Next: Intrinsics in PARAMETER Statements,  Prev: Better Source Model,  Up: Missing Features
  780.  
  781. Fortran 90 Support
  782. ------------------
  783.  
  784.    `g77' does not support many of the features that distinguish Fortran
  785. 90 (and, now, Fortran 95) from ANSI FORTRAN 77.
  786.  
  787.    Some Fortran 90 features are supported, because they make sense to
  788. offer even to die-hard users of F77.  For example, many of them codify
  789. various ways F77 has been extended to meet users' needs during its
  790. tenure, so `g77' might as well offer them as the primary way to meet
  791. those same needs, even if it offers compatibility with one or more of
  792. the ways those needs were met by other F77 compilers in the industry.
  793.  
  794.    Still, many important F90 features are not supported, because no
  795. attempt has been made to research each and every feature and assess its
  796. viability in `g77'.  In the meantime, users who need those features must
  797. use Fortran 90 compilers anyway, and the best approach to adding some
  798. F90 features to GNU Fortran might well be to fund a comprehensive
  799. project to create GNU Fortran 95.
  800.  
  801. 
  802. File: g77.info,  Node: Intrinsics in PARAMETER Statements,  Next: SELECT CASE on CHARACTER Type,  Prev: Fortran 90 Support,  Up: Missing Features
  803.  
  804. Intrinsics in `PARAMETER' Statements
  805. ------------------------------------
  806.  
  807.    `g77' doesn't allow intrinsics in `PARAMETER' statements.  This
  808. feature is considered to be absolutely vital, even though it is not
  809. standard-conforming, and is scheduled for version 0.6.
  810.  
  811.    Related to this, `g77' doesn't allow non-integral exponentiation in
  812. `PARAMETER' statements, such as `PARAMETER (R=2**.25)'.  It is unlikely
  813. `g77' will ever support this feature, as doing it properly requires
  814. complete emulation of a target computer's floating-point facilities when
  815. building `g77' as a cross-compiler.  But, if the `gcc' back end is
  816. enhanced to provide such a facility, `g77' will likely use that facility
  817. in implementing this feature soon afterwards.
  818.  
  819. 
  820. File: g77.info,  Node: SELECT CASE on CHARACTER Type,  Next: RECURSIVE Keyword,  Prev: Intrinsics in PARAMETER Statements,  Up: Missing Features
  821.  
  822. `SELECT CASE' on `CHARACTER' Type
  823. ---------------------------------
  824.  
  825.    Character-type selector/cases for `SELECT CASE' currently are not
  826. supported.
  827.  
  828. 
  829. File: g77.info,  Node: RECURSIVE Keyword,  Next: Popular Non-standard Types,  Prev: SELECT CASE on CHARACTER Type,  Up: Missing Features
  830.  
  831. `RECURSIVE' Keyword
  832. -------------------
  833.  
  834.    `g77' doesn't support the `RECURSIVE' keyword that F90 compilers do.
  835. Nor does it provide any means for compiling procedures designed to do
  836. recursion.
  837.  
  838.    All recursive code can be rewritten to not use recursion, but the
  839. result is not pretty.
  840.  
  841. 
  842. File: g77.info,  Node: Increasing Precision/Range,  Next: Gracefully Handle Sensible Bad Code,  Prev: Support for Threads,  Up: Missing Features
  843.  
  844. Increasing Precision/Range
  845. --------------------------
  846.  
  847.    Some compilers, such as `f2c', have an option (`-r8' or similar)
  848. that provides automatic treatment of `REAL' entities such that they
  849. have twice the storage size, and a corresponding increase in the range
  850. and precision, of what would normally be the `REAL(KIND=1)' (default
  851. `REAL') type.  (This affects `COMPLEX' the same way.)
  852.  
  853.    They also typically offer another option (`-i8') to increase
  854. `INTEGER' entities so they are twice as large (with roughly twice as
  855. much range).
  856.  
  857.    (There are potential pitfalls in using these options.)
  858.  
  859.    `g77' does not yet offer any option that performs these kinds of
  860. transformations.  Part of the problem is the lack of detailed
  861. specifications regarding exactly how these options affect the
  862. interpretation of constants, intrinsics, and so on.
  863.  
  864.    Until `g77' addresses this need, programmers could improve the
  865. portability of their code by modifying it to not require compile-time
  866. options to produce correct results.  Some free tools are available
  867. which may help, specifically in Toolpack (which one would expect to be
  868. sound) and the `fortran' section of the Netlib repository.
  869.  
  870.    Use of preprocessors can provide a fairly portable means to work
  871. around the lack of widely portable methods in the Fortran language
  872. itself (though increasing acceptance of Fortran 90 would alleviate this
  873. problem).
  874.  
  875. 
  876. File: g77.info,  Node: Popular Non-standard Types,  Next: Full Support for Compiler Types,  Prev: RECURSIVE Keyword,  Up: Missing Features
  877.  
  878. Popular Non-standard Types
  879. --------------------------
  880.  
  881.    `g77' doesn't fully support `INTEGER*2', `LOGICAL*1', and similar.
  882. Version 0.6 will provide full support for this very popular set of
  883. features.  In the meantime, version 0.5.18 provides rudimentary support
  884. for them.
  885.  
  886. 
  887. File: g77.info,  Node: Full Support for Compiler Types,  Next: Array Bounds Expressions,  Prev: Popular Non-standard Types,  Up: Missing Features
  888.  
  889. Full Support for Compiler Types
  890. -------------------------------
  891.  
  892.    `g77' doesn't support `INTEGER', `REAL', and `COMPLEX' equivalents
  893. for *all* applicable back-end-supported types (`char', `short int',
  894. `int', `long int', `long long int', and `long double').  This means
  895. providing intrinsic support, and maybe constant support (using F90
  896. syntax) as well, and, for most machines will result in automatic
  897. support of `INTEGER*1', `INTEGER*2', `INTEGER*8', maybe even `REAL*16',
  898. and so on.  This is scheduled for version 0.6.
  899.  
  900. 
  901. File: g77.info,  Node: Array Bounds Expressions,  Next: POINTER Statements,  Prev: Full Support for Compiler Types,  Up: Missing Features
  902.  
  903. Array Bounds Expressions
  904. ------------------------
  905.  
  906.    `g77' doesn't support more general expressions to dimension arrays,
  907. such as array element references, function references, etc.
  908.  
  909.    For example, `g77' currently does not accept the following:
  910.  
  911.      SUBROUTINE X(M, N)
  912.      INTEGER N(10), M(N(2), N(1))
  913.  
  914. 
  915. File: g77.info,  Node: POINTER Statements,  Next: Sensible Non-standard Constructs,  Prev: Array Bounds Expressions,  Up: Missing Features
  916.  
  917. POINTER Statements
  918. ------------------
  919.  
  920.    `g77' doesn't support pointers or allocatable objects (other than
  921. automatic arrays).  This set of features is probably considered just
  922. behind intrinsics in `PARAMETER' statements on the list of large,
  923. important things to add to `g77'.
  924.  
  925.    In the meantime, consider using the `INTEGER(KIND=7)' declaration to
  926. specify that a variable must be able to hold a pointer.  This construct
  927. is not portable to other non-GNU compilers, but it is portable to all
  928. machines GNU Fortran supports when `g77' is used.
  929.  
  930.    *Note Functions and Subroutines::, for information on `%VAL()',
  931. `%REF()', and `%DESCR()' constructs, which are useful for passing
  932. pointers to procedures written in languages other than Fortran.
  933.  
  934. 
  935. File: g77.info,  Node: Sensible Non-standard Constructs,  Next: FLUSH Statement,  Prev: POINTER Statements,  Up: Missing Features
  936.  
  937. Sensible Non-standard Constructs
  938. --------------------------------
  939.  
  940.    `g77' rejects things other compilers accept, like `INTRINSIC
  941. SQRT,SQRT'.  As time permits in the future, some of these things that
  942. are easy for humans to read and write and unlikely to be intended to
  943. mean something else will be accepted by `g77' (though `-fpedantic'
  944. should trigger warnings about such non-standard constructs).
  945.  
  946.    Until `g77' no longer gratuitously rejects sensible code, you might
  947. as well fix your code to be more standard-conforming and portable.
  948.  
  949.    The kind of case that is important to except from the recommendation
  950. to change your code is one where following good coding rules would
  951. force you to write non-standard code that nevertheless has a clear
  952. meaning.
  953.  
  954.    For example, when writing an `INCLUDE' file that defines a common
  955. block, it might be appropriate to include a `SAVE' statement for the
  956. common block (such as `SAVE /CBLOCK/'), so that variables defined in
  957. the common block retain their values even when all procedures declaring
  958. the common block become inactive (return to their callers).
  959.  
  960.    However, putting `SAVE' statements in an `INCLUDE' file would
  961. prevent otherwise standard-conforming code from also specifying the
  962. `SAVE' statement, by itself, to indicate that all local variables and
  963. arrays are to have the `SAVE' attribute.
  964.  
  965.    For this reason, `g77' already has been changed to allow this
  966. combination, because although the general problem of gratuitously
  967. rejecting unambiguous and "safe" constructs still exists in `g77', this
  968. particular construct was deemed useful enough that it was worth fixing
  969. `g77' for just this case.
  970.  
  971.    So, while there is no need to change your code to avoid using this
  972. particular construct, there might be other, equally appropriate but
  973. non-standard constructs, that you shouldn't have to stop using just
  974. because `g77' (or any other compiler) gratuitously rejects it.
  975.  
  976.    Until the general problem is solved, if you have any such construct
  977. you believe is worthwhile using (e.g. not just an arbitrary, redundant
  978. specification of an attribute), please submit a bug report with an
  979. explanation, so we can consider fixing `g77' just for cases like yours.
  980.  
  981. 
  982. File: g77.info,  Node: FLUSH Statement,  Next: Expressions in FORMAT Statements,  Prev: Sensible Non-standard Constructs,  Up: Missing Features
  983.  
  984. `FLUSH' Statement
  985. -----------------
  986.  
  987.    `g77' could perhaps use a `FLUSH' statement that does what `CALL
  988. FLUSH' does, but that supports `*' as the unit designator (same unit as
  989. for `PRINT') and accepts `ERR=' and/or `IOSTAT=' specifiers.
  990.  
  991. 
  992. File: g77.info,  Node: Expressions in FORMAT Statements,  Next: Explicit Assembler Code,  Prev: FLUSH Statement,  Up: Missing Features
  993.  
  994. Expressions in `FORMAT' Statements
  995. ----------------------------------
  996.  
  997.    `g77' doesn't support `FORMAT(I<J>)' and the like.  Supporting this
  998. requires a significant redesign or replacement of `libf2c'.
  999.  
  1000.    However, a future version of `g77' might support this construct when
  1001. the expression is constant.  For example:
  1002.  
  1003.            PARAMETER (IWIDTH = 12)
  1004.      10    FORMAT (I<IWIDTH>)
  1005.  
  1006.    In the meantime, at least for output (`PRINT' and `WRITE'), Fortran
  1007. code making use of this feature can be rewritten to avoid it by
  1008. constructing the `FORMAT' string in a `CHARACTER' variable or array,
  1009. then using that variable or array in place of the `FORMAT' statement
  1010. label to do the original `PRINT' or `WRITE'.
  1011.  
  1012.    Many uses of this feature on input can be rewritten this way as
  1013. well, but not all can.  For example, this can be rewritten:
  1014.  
  1015.            READ 20, I
  1016.      20    FORMAT (I<J>)
  1017.  
  1018.    However, this cannot, in general, be rewritten, especially when
  1019. `ERR=' and `END=' constructs are employed:
  1020.  
  1021.            READ 30, J, I
  1022.      30    FORMAT (I<J>)
  1023.  
  1024. 
  1025. File: g77.info,  Node: Explicit Assembler Code,  Next: Q Edit Descriptor,  Prev: Expressions in FORMAT Statements,  Up: Missing Features
  1026.  
  1027. Explicit Assembler Code
  1028. -----------------------
  1029.  
  1030.    `g77' needs to provide some way, a la `gcc', for `g77' code to
  1031. specify explicit assembler code.
  1032.  
  1033. 
  1034. File: g77.info,  Node: Q Edit Descriptor,  Next: Old-style PARAMETER Statements,  Prev: Explicit Assembler Code,  Up: Missing Features
  1035.  
  1036. Q Edit Descriptor
  1037. -----------------
  1038.  
  1039.    The `Q' edit descriptor in `FORMAT's isn't supported.  (This is
  1040. meant to get the number of characters remaining in an input record.)
  1041. Supporting this requires a significant redesign or replacement of
  1042. `libf2c'.
  1043.  
  1044.    A workaround might be using internal I/O or the stream-based
  1045. intrinsics.  *Note FGetC Intrinsic (subroutine)::.
  1046.  
  1047. 
  1048. File: g77.info,  Node: Old-style PARAMETER Statements,  Next: TYPE and ACCEPT I/O Statements,  Prev: Q Edit Descriptor,  Up: Missing Features
  1049.  
  1050. Old-style PARAMETER Statements
  1051. ------------------------------
  1052.  
  1053.    `g77' doesn't accept `PARAMETER I=1'.  Supporting this obsolete form
  1054. of the `PARAMETER' statement would not be particularly hard, as most of
  1055. the parsing code is already in place and working.
  1056.  
  1057.    Until time/money is spent implementing it, you might as well fix
  1058. your code to use the standard form, `PARAMETER (I=1)' (possibly needing
  1059. `INTEGER I' preceding the `PARAMETER' statement as well, otherwise, in
  1060. the obsolete form of `PARAMETER', the type of the variable is set from
  1061. the type of the constant being assigned to it).
  1062.  
  1063. 
  1064. File: g77.info,  Node: TYPE and ACCEPT I/O Statements,  Next: STRUCTURE UNION RECORD MAP,  Prev: Old-style PARAMETER Statements,  Up: Missing Features
  1065.  
  1066. `TYPE' and `ACCEPT' I/O Statements
  1067. ----------------------------------
  1068.  
  1069.    `g77' doesn't support the I/O statements `TYPE' and `ACCEPT'.  These
  1070. are common extensions that should be easy to support, but also are
  1071. fairly easy to work around in user code.
  1072.  
  1073.    Generally, any `TYPE fmt,list' I/O statement can be replaced by
  1074. `PRINT fmt,list'.  And, any `ACCEPT fmt,list' statement can be replaced
  1075. by `READ fmt,list'.
  1076.  
  1077. 
  1078. File: g77.info,  Node: STRUCTURE UNION RECORD MAP,  Next: OPEN CLOSE and INQUIRE Keywords,  Prev: TYPE and ACCEPT I/O Statements,  Up: Missing Features
  1079.  
  1080. `STRUCTURE', `UNION', `RECORD', `MAP'
  1081. -------------------------------------
  1082.  
  1083.    `g77' doesn't support `STRUCTURE', `UNION', `RECORD', `MAP'.  This
  1084. set of extensions is quite a bit lower on the list of large, important
  1085. things to add to `g77', partly because it requires a great deal of work
  1086. either upgrading or replacing `libf2c'.
  1087.  
  1088. 
  1089. File: g77.info,  Node: OPEN CLOSE and INQUIRE Keywords,  Next: ENCODE and DECODE,  Prev: STRUCTURE UNION RECORD MAP,  Up: Missing Features
  1090.  
  1091. `OPEN', `CLOSE', and `INQUIRE' Keywords
  1092. ---------------------------------------
  1093.  
  1094.    `g77' doesn't have support for keywords such as `DISP='DELETE'' in
  1095. the `OPEN', `CLOSE', and `INQUIRE' statements.  These extensions are
  1096. easy to add to `g77' itself, but require much more work on `libf2c'.
  1097.  
  1098. 
  1099. File: g77.info,  Node: ENCODE and DECODE,  Next: Suppressing Space Padding,  Prev: OPEN CLOSE and INQUIRE Keywords,  Up: Missing Features
  1100.  
  1101. `ENCODE' and `DECODE'
  1102. ---------------------
  1103.  
  1104.    `g77' doesn't support `ENCODE' or `DECODE'.
  1105.  
  1106.    These statements are best replaced by READ and WRITE statements
  1107. involving internal files (CHARACTER variables and arrays).
  1108.  
  1109.    For example, replace a code fragment like
  1110.  
  1111.            INTEGER*1 LINE(80)
  1112.      ...
  1113.            DECODE (80, 9000, LINE) A, B, C
  1114.      ...
  1115.      9000  FORMAT (1X, 3(F10.5))
  1116.  
  1117. with:
  1118.  
  1119.            CHARACTER*80 LINE
  1120.      ...
  1121.            READ (UNIT=LINE, FMT=9000) A, B, C
  1122.      ...
  1123.      9000  FORMAT (1X, 3(F10.5))
  1124.  
  1125.    Similarly, replace a code fragment like
  1126.  
  1127.            INTEGER*1 LINE(80)
  1128.      ...
  1129.            ENCODE (80, 9000, LINE) A, B, C
  1130.      ...
  1131.      9000  FORMAT (1X, 'OUTPUT IS ', 3(F10.5))
  1132.  
  1133. with:
  1134.  
  1135.            CHARACTER*80 LINE
  1136.      ...
  1137.            WRITE (UNIT=LINE, FMT=9000) A, B, C
  1138.      ...
  1139.      9000  FORMAT (1X, 'OUTPUT IS ', 3(F10.5))
  1140.  
  1141.    It is entirely possible that `ENCODE' and `DECODE' will be supported
  1142. by a future version of `g77'.
  1143.  
  1144. 
  1145. File: g77.info,  Node: Suppressing Space Padding,  Next: Fortran Preprocessor,  Prev: ENCODE and DECODE,  Up: Missing Features
  1146.  
  1147. Suppressing Space Padding of Source Lines
  1148. -----------------------------------------
  1149.  
  1150.    `g77' should offer VXT-Fortran-style suppression of virtual spaces
  1151. at the end of a source line if an appropriate command-line option is
  1152. specified.
  1153.  
  1154.    This affects cases where a character constant is continued onto the
  1155. next line in a fixed-form source file, as in the following example:
  1156.  
  1157.      10    PRINT *,'HOW MANY
  1158.           1 SPACES?'
  1159.  
  1160. `g77', and many other compilers, virtually extend the continued line
  1161. through column 72 with spaces that become part of the character
  1162. constant, but Digital Fortran normally didn't, leaving only one space
  1163. between `MANY' and `SPACES?'  in the output of the above statement.
  1164.  
  1165.    Fairly recently, at least one version of Digital Fortran was
  1166. enhanced to provide the other behavior when a command-line option is
  1167. specified, apparently due to demand from readers of the USENET group
  1168. `comp.lang.fortran' to offer conformance to this widespread practice in
  1169. the industry.  `g77' should return the favor by offering conformance to
  1170. Digital's approach to handling the above example.
  1171.  
  1172. 
  1173. File: g77.info,  Node: Fortran Preprocessor,  Next: Bit Operations on Floating-point Data,  Prev: Suppressing Space Padding,  Up: Missing Features
  1174.  
  1175. Fortran Preprocessor
  1176. --------------------
  1177.  
  1178.    `g77' should offer a preprocessor designed specifically for Fortran
  1179. to replace `cpp -traditional'.  There are several out there worth
  1180. evaluating, at least.
  1181.  
  1182.    Such a preprocessor would recognize Hollerith constants, properly
  1183. parse comments and character constants, and so on.  It might also
  1184. recognize, process, and thus preprocess files included via the
  1185. `INCLUDE' directive.
  1186.  
  1187. 
  1188. File: g77.info,  Node: Bit Operations on Floating-point Data,  Next: POSIX Standard,  Prev: Fortran Preprocessor,  Up: Missing Features
  1189.  
  1190. Bit Operations on Floating-point Data
  1191. -------------------------------------
  1192.  
  1193.    `g77' does not allow `REAL' and other non-integral types for
  1194. arguments to intrinsics like `AND', `OR', and `SHIFT'.
  1195.  
  1196.    For example, this program is rejected by `g77', because the
  1197. intrinsic `IAND' does not accept `REAL' arguments:
  1198.  
  1199.      DATA A/7.54/, B/9.112/
  1200.      PRINT *, IAND(A, B)
  1201.      END
  1202.  
  1203. 
  1204. File: g77.info,  Node: POSIX Standard,  Next: Floating-point Exception Handling,  Prev: Bit Operations on Floating-point Data,  Up: Missing Features
  1205.  
  1206. `POSIX' Standard
  1207. ----------------
  1208.  
  1209.    `g77' should support the POSIX standard for Fortran.
  1210.  
  1211.