home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 5 / FreshFish_July-August1994.bin / bbs / gnu / gcc-2.5.8-bin.lha / info / gcc.info-10 (.txt) < prev    next >
GNU Info File  |  1994-07-11  |  38KB  |  648 lines

  1. This is Info file gcc.info, produced by Makeinfo-1.55 from the input
  2. file gcc.texi.
  3.    This file documents the use and the internals of the GNU compiler.
  4.    Published by the Free Software Foundation 675 Massachusetts Avenue
  5. Cambridge, MA 02139 USA
  6.    Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
  7.    Permission is granted to make and distribute verbatim copies of this
  8. manual provided the copyright notice and this permission notice are
  9. preserved on all copies.
  10.    Permission is granted to copy and distribute modified versions of
  11. this manual under the conditions for verbatim copying, provided also
  12. that the sections entitled "GNU General Public License" and "Protect
  13. Your Freedom--Fight `Look And Feel'" are included exactly as in the
  14. original, and provided that the entire resulting derived work is
  15. distributed under the terms of a permission notice identical to this
  16.    Permission is granted to copy and distribute translations of this
  17. manual into another language, under the above conditions for modified
  18. versions, except that the sections entitled "GNU General Public
  19. License" and "Protect Your Freedom--Fight `Look And Feel'", and this
  20. permission notice, may be included in translations approved by the Free
  21. Software Foundation instead of in the original English.
  22. File: gcc.info,  Node: Bug Reporting,  Next: Sending Patches,  Prev: Bug Lists,  Up: Bugs
  23. How to Report Bugs
  24. ==================
  25.    The fundamental principle of reporting bugs usefully is this:
  26. *report all the facts*.  If you are not sure whether to state a fact or
  27. leave it out, state it!
  28.    Often people omit facts because they think they know what causes the
  29. problem and they conclude that some details don't matter.  Thus, you
  30. might assume that the name of the variable you use in an example does
  31. not matter.  Well, probably it doesn't, but one cannot be sure.
  32. Perhaps the bug is a stray memory reference which happens to fetch from
  33. the location where that name is stored in memory; perhaps, if the name
  34. were different, the contents of that location would fool the compiler
  35. into doing the right thing despite the bug.  Play it safe and give a
  36. specific, complete example.  That is the easiest thing for you to do,
  37. and the most helpful.
  38.    Keep in mind that the purpose of a bug report is to enable someone to
  39. fix the bug if it is not known.  It isn't very important what happens if
  40. the bug is already known.  Therefore, always write your bug reports on
  41. the assumption that the bug is not known.
  42.    Sometimes people give a few sketchy facts and ask, "Does this ring a
  43. bell?"  This cannot help us fix a bug, so it is basically useless.  We
  44. respond by asking for enough details to enable us to investigate.  You
  45. might as well expedite matters by sending them to begin with.
  46.    Try to make your bug report self-contained.  If we have to ask you
  47. for more information, it is best if you include all the previous
  48. information in your response, as well as the information that was
  49. missing.
  50.    To enable someone to investigate the bug, you should include all
  51. these things:
  52.    * The version of GNU CC.  You can get this by running it with the
  53.      `-v' option.
  54.      Without this, we won't know whether there is any point in looking
  55.      for the bug in the current version of GNU CC.
  56.    * A complete input file that will reproduce the bug.  If the bug is
  57.      in the C preprocessor, send a source file and any header files
  58.      that it requires.  If the bug is in the compiler proper (`cc1'),
  59.      run your source file through the C preprocessor by doing `gcc -E
  60.      SOURCEFILE > OUTFILE', then include the contents of OUTFILE in the
  61.      bug report.  (When you do this, use the same `-I', `-D' or `-U'
  62.      options that you used in actual compilation.)
  63.      A single statement is not enough of an example.  In order to
  64.      compile it, it must be embedded in a complete file of compiler
  65.      input; and the bug might depend on the details of how this is done.
  66.      Without a real example one can compile, all anyone can do about
  67.      your bug report is wish you luck.  It would be futile to try to
  68.      guess how to provoke the bug.  For example, bugs in register
  69.      allocation and reloading frequently depend on every little detail
  70.      of the function they happen in.
  71.      Even if the input file that fails comes from a GNU program, you
  72.      should still send the complete test case.  Don't ask the GNU CC
  73.      maintainers to do the extra work of obtaining the program in
  74.      question--they are all overworked as it is.  Also, the problem may
  75.      depend on what is in the header files on your system; it is
  76.      unreliable for the GNU CC maintainers to try the problem with the
  77.      header files available to them.  By sending CPP output, you can
  78.      eliminate this source of uncertainty and save us a certain
  79.      percentage of wild goose chases.
  80.    * The command arguments you gave GNU CC or GNU C++ to compile that
  81.      example and observe the bug.  For example, did you use `-O'?  To
  82.      guarantee you won't omit something important, list all the options.
  83.      If we were to try to guess the arguments, we would probably guess
  84.      wrong and then we would not encounter the bug.
  85.    * The type of machine you are using, and the operating system name
  86.      and version number.
  87.    * The operands you gave to the `configure' command when you installed
  88.      the compiler.
  89.    * A complete list of any modifications you have made to the compiler
  90.      source.  (We don't promise to investigate the bug unless it
  91.      happens in an unmodified compiler.  But if you've made
  92.      modifications and don't tell us, then you are sending us on a wild
  93.      goose chase.)
  94.      Be precise about these changes.  A description in English is not
  95.      enough--send a context diff for them.
  96.      Adding files of your own (such as a machine description for a
  97.      machine we don't support) is a modification of the compiler source.
  98.    * Details of any other deviations from the standard procedure for
  99.      installing GNU CC.
  100.    * A description of what behavior you observe that you believe is
  101.      incorrect.  For example, "The compiler gets a fatal signal," or,
  102.      "The assembler instruction at line 208 in the output is incorrect."
  103.      Of course, if the bug is that the compiler gets a fatal signal,
  104.      then one can't miss it.  But if the bug is incorrect output, the
  105.      maintainer might not notice unless it is glaringly wrong.  None of
  106.      us has time to study all the assembler code from a 50-line C
  107.      program just on the chance that one instruction might be wrong.
  108.      We need *you* to do this part!
  109.      Even if the problem you experience is a fatal signal, you should
  110.      still say so explicitly.  Suppose something strange is going on,
  111.      such as, your copy of the compiler is out of synch, or you have
  112.      encountered a bug in the C library on your system.  (This has
  113.      happened!)  Your copy might crash and the copy here would not.  If
  114.      you said to expect a crash, then when the compiler here fails to
  115.      crash, we would know that the bug was not happening.  If you don't
  116.      say to expect a crash, then we would not know whether the bug was
  117.      happening.  We would not be able to draw any conclusion from our
  118.      observations.
  119.      If the problem is a diagnostic when compiling GNU CC with some
  120.      other compiler, say whether it is a warning or an error.
  121.      Often the observed symptom is incorrect output when your program
  122.      is run.  Sad to say, this is not enough information unless the
  123.      program is short and simple.  None of us has time to study a large
  124.      program to figure out how it would work if compiled correctly,
  125.      much less which line of it was compiled wrong.  So you will have
  126.      to do that.  Tell us which source line it is, and what incorrect
  127.      result happens when that line is executed.  A person who
  128.      understands the program can find this as easily as finding a bug
  129.      in the program itself.
  130.    * If you send examples of assembler code output from GNU CC or GNU
  131.      C++, please use `-g' when you make them.  The debugging information
  132.      includes source line numbers which are essential for correlating
  133.      the output with the input.