home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / f / fortran / GCCmain / !gcc / docs / bugs < prev    next >
Encoding:
Text File  |  1996-11-08  |  11.6 KB  |  255 lines

  1. This document is a modification from !gcc.docs.gccuser of the
  2. *Reporting Bugs* section. Please use the information supplied here
  3. rather than in !gcc.docs.gccuser.
  4.  
  5. Throughout the document, reference is make to GCC. This is a collective
  6. term used to describe GNU C, Obj-C, C++, GNAT Ada and Fortran. In the
  7. section *Where to report bugs* is a list of e-mail addresses for where
  8. bugs should be sent depending on the particular compiler you are using.
  9.  
  10. Reporting Bugs
  11. **************
  12.  
  13.    Your bug reports play an essential role in making GCC reliable.
  14.  
  15.    When you encounter a problem, the first thing to do is to see if it
  16. is already known.  If it isn't known, then you should report the problem.
  17.  
  18.    Reporting a bug may help you by bringing a solution to your problem,
  19. or it may not.  In any case, the principal function of a bug report
  20. is to help the entire community by making the next version of GCC
  21. work better.  Bug reports are your contribution to the maintenance of
  22. GCC and should be sent by e-mail to one of the relevant addresses in the
  23. section *Where to report bugs*. If you do not have access to e-mail, then
  24. try posting the problem to one of the porters postal addresses. 
  25.  
  26.    Since the maintainers are very overloaded, we cannot respond to every
  27. bug report, although we will try to cure as many as possible.
  28.  
  29.    In order for a bug report to serve its purpose, you must include the
  30. information that makes for fixing the bug.
  31.  
  32. Have You Found a Bug?
  33. =====================
  34.  
  35.    If you are not sure whether you have found a bug, here are some
  36. guidelines:
  37.  
  38.    * If the compiler gets a fatal signal, for any input whatever, that
  39.      is a compiler bug.  Reliable compilers never crash.
  40.  
  41.    * If the compiler produces invalid assembly code, for any input
  42.      whatever (except an `asm' statement), that is a compiler bug,
  43.      unless the compiler reports errors (not just warnings) which would
  44.      ordinarily prevent the assembler from being run.
  45.  
  46.    * If the compiler produces valid assembly code that does not
  47.      correctly execute the input source code, that is a compiler bug.
  48.  
  49.      However, you must double-check to make sure, because you may have
  50.      run into an incompatibility between the GNU language implementation
  51.      and the traditional language implementation.  These incompatibilities
  52.      might be considered bugs, but they are inescapable consequences of
  53.      valuable features.
  54.  
  55.      Or you may have a program whose behavior is undefined, which
  56.      happened by chance to give the desired results with another third
  57.      party compiler.
  58.  
  59.      For example, whilst using C, in many nonoptimizing compilers, you
  60.      can write `x;' at the end of a function instead of `return x;', with
  61.      the same results.  But the value of the function is undefined if
  62.      `return' is omitted; it is not a bug when GNU C produces different
  63.      results.
  64.  
  65.      Problems often result from expressions with two increment
  66.      operators, as in `f (*p++, *p++)'.  Your previous compiler might
  67.      have interpreted that expression the way you intended; GNU CC might
  68.      interpret it another way.  Neither compiler is wrong.  The bug is
  69.      in your code.
  70.  
  71.      After you have localized the error to a single source line, it
  72.      should be easy to check for these things.  If your program is
  73.      correct and well defined, you have found a compiler bug.
  74.  
  75.    * If the compiler produces an error message for valid input, that is
  76.      a compiler bug.
  77.  
  78.    * If the compiler does not produce an error message for invalid
  79.      input, that is a compiler bug.  However, you should note that your
  80.      idea of "invalid input" might be my idea of "an extension" or
  81.      "support for traditional practice".
  82.  
  83.    * If you are an experienced user of other language compilers, your
  84.      suggestions for improvement of the equivalent GNU compilers are
  85.      always welcome.
  86.  
  87. Where to Report Bugs
  88. ====================
  89.  
  90. Different people have ported different compilers. Here is list of the
  91. e-mail addresses you should should when reporting a possible bug.
  92.  
  93. Bug reports relating to GNU C, GNU C++, GNU Objective-C, GNU Fortran
  94. and GNU Pascal should be sent to:
  95.   Nick Burrett: nickb@digibank.demon.co.uk
  96.  
  97. Bug reports relating to GNU GNAT Ada should be sent to:
  98.   Peter Burwood: gnat@arcangel.dircon.co.uk
  99.  
  100.    *Do not send bug reports to `help-gcc@prep.ai.mit.edu' or to the
  101. newsgroup `gnu.gcc.help'.* Most users of GNU CC do not want to receive
  102. bug reports.
  103.  
  104.  
  105. How to Report Bugs
  106. ==================
  107.  
  108.    The fundamental principle of reporting bugs usefully is this:
  109. *report all the facts*.  If you are not sure whether to state a fact or
  110. leave it out, state it!
  111.  
  112.    Often people omit facts because they think they know what causes the
  113. problem and they conclude that some details don't matter.  Thus, you
  114. might assume that the name of the variable you use in an example does
  115. not matter.  Well, probably it doesn't, but one cannot be sure.
  116. Perhaps the bug is a stray memory reference which happens to fetch from
  117. the location where that name is stored in memory; perhaps, if the name
  118. were different, the contents of that location would fool the compiler
  119. into doing the right thing despite the bug.  Play it safe and give a
  120. specific, complete example.  That is the easiest thing for you to do,
  121. and the most helpful.
  122.  
  123.    Keep in mind that the purpose of a bug report is to enable someone to
  124. fix the bug if it is not known.  It isn't very important what happens if
  125. the bug is already known.  Therefore, always write your bug reports on
  126. the assumption that the bug is not known.
  127.  
  128.    Sometimes people give a few sketchy facts and ask, "Does this ring a
  129. bell?"  This cannot help us fix a bug, so it is basically useless.  We
  130. respond by asking for enough details to enable us to investigate.  You
  131. might as well expedite matters by sending them to begin with.
  132.  
  133.    Try to make your bug report self-contained.  If we have to ask you
  134. for more information, it is best if you include all the previous
  135. information in your response, as well as the information that was
  136. missing.
  137.  
  138.    Please report each bug in a separate message.  This makes it easier
  139. for us to track which bugs have been fixed and to forward your bugs
  140. reports to the appropriate maintainer.
  141.  
  142.    To enable someone to investigate the bug, you should include all
  143. these things:
  144.  
  145.    * The version of GCC.  You can get this by running it with the
  146.      `-v' option.
  147.  
  148.      Without this, we won't know whether there is any point in looking
  149.      for the bug in the current version of GNU CC.
  150.      
  151.      Please include the ARM/RISC OS backend version e.g.
  152.      
  153.      GNU C version 2.7.2 (ARM/RISC OS v1.0.5)
  154.      
  155.      GCC version is 2.7.2.
  156.      ARM/RISC OS backend version is 1.0.5.
  157.  
  158.    * A complete input file that will reproduce the bug.  If the bug is
  159.      in the C preprocessor, send a source file and any header files
  160.      that it requires.  If the bug is in the compiler proper (`cc1'),
  161.      run your source file through the C preprocessor by doing `gcc -E
  162.      SOURCEFILE > OUTFILE', then include the contents of OUTFILE in the
  163.      bug report.  (When you do this, use the same `-I', `-D' or `-U'
  164.      options that you used in actual compilation.)
  165.  
  166.      A single statement is not enough of an example.  In order to
  167.      compile it, it must be embedded in a complete file of compiler
  168.      input; and the bug might depend on the details of how this is done.
  169.  
  170.      Without a real example one can compile, all anyone can do about
  171.      your bug report is wish you luck.  It would be futile to try to
  172.      guess how to provoke the bug.  For example, bugs in register
  173.      allocation and reloading frequently depend on every little detail
  174.      of the function they happen in.
  175.  
  176.      The problem may depend on what is in the header files on your system;
  177.      it is unreliable for the GCC maintainers to try the problem with the
  178.      header files available to them.  By sending CPP output, you can
  179.      eliminate this source of uncertainty and save us a certain
  180.      percentage of wild goose chases.
  181.  
  182.    * The command arguments you gave GCC to compile that
  183.      example and observe the bug.  For example, did you use `-O'?  To
  184.      guarantee you won't omit something important, list all the options.
  185.  
  186.      If we were to try to guess the arguments, we would probably guess
  187.      wrong and then we would not encounter the bug.
  188.  
  189.    * The type of machine you are using, and the operating system name
  190.      and version number.
  191.  
  192.    * A description of what behavior you observe that you believe is
  193.      incorrect.  For example, "The compiler gets a fatal signal," or,
  194.      "The assembler instruction at line 208 in the output is incorrect."
  195.  
  196.      Of course, if the bug is that the compiler gets a fatal signal,
  197.      then one can't miss it.  But if the bug is incorrect output, the
  198.      maintainer might not notice unless it is glaringly wrong.  None of
  199.      us has time to study all the assembler code from a 50-line C
  200.      program just on the chance that one instruction might be wrong.
  201.      We need *you* to do this part!
  202.  
  203.      Even if the problem you experience is a fatal signal, you should
  204.      still say so explicitly.  Suppose something strange is going on,
  205.      such as you have encountered a bug in the C library on your system.
  206.      (This has happened!)  Your copy might crash and the copy here would
  207.      not.  If you said to expect a crash, then when the compiler here fails
  208.      to crash, we would know that the bug was not happening.  If you don't
  209.      say to expect a crash, then we would not know whether the bug was
  210.      happening.  We would not be able to draw any conclusion from our
  211.      observations.
  212.  
  213.      Often the observed symptom is incorrect output when your program
  214.      is run.  Sad to say, this is not enough information unless the
  215.      program is short and simple.  None of us has time to study a large
  216.      program to figure out how it would work if compiled correctly,
  217.      much less which line of it was compiled wrong.  So you will have
  218.      to do that.  Tell us which source line it is, and what incorrect
  219.      result happens when that line is executed.  A person who
  220.      understands the program can find this as easily as finding a bug
  221.      in the program itself.
  222.  
  223.    Here are some things that are not necessary:
  224.  
  225.    * A description of the envelope of the bug.
  226.  
  227.      Often people who encounter a bug spend a lot of time investigating
  228.      which changes to the input file will make the bug go away and which
  229.      changes will not affect it.
  230.  
  231.      This is often time consuming and not very useful, because the way
  232.      we will find the bug is by running a single example under the
  233.      debugger with breakpoints, not by pure deduction from a series of
  234.      examples.  You might as well save your time for something else.
  235.  
  236.      Of course, if you can find a simpler example to report *instead* of
  237.      the original one, that is a convenience.  Errors in the output
  238.      will be easier to spot, running under the debugger will take less
  239.      time, etc.  Most GCC bugs involve just one function, so the
  240.      most straightforward way to simplify an example is to delete all
  241.      the function definitions except the one where the bug occurs.
  242.      Those earlier in the file may be replaced by external declarations
  243.      if the crucial function depends on them.  (Exception: inline
  244.      functions may affect compilation of functions defined later in the
  245.      file.)
  246.  
  247.      However, simplification is not vital; if you don't want to do this,
  248.      report the bug anyway and send the entire test case you used.
  249.  
  250.    * In particular, some people insert conditionals `#ifdef BUG' around
  251.      a statement which, if removed, makes the bug not happen.  These
  252.      are just clutter; we won't pay any attention to them anyway.
  253.      Besides, you should send us cpp output, and that can't have
  254.      conditionals.
  255.