home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD1.bin
/
gnu
/
info
/
gcc.info-11
(
.txt
)
< prev
next >
Wrap
GNU Info File
|
1994-12-22
|
39KB
|
654 lines
This is Info file gcc.info, produced by Makeinfo-1.55 from the input
file gcc.texi.
This file documents the use and the internals of the GNU compiler.
Published by the Free Software Foundation 675 Massachusetts Avenue
Cambridge, MA 02139 USA
Copyright (C) 1988, 1989, 1992, 1993, 1994 Free Software Foundation,
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided also
that the sections entitled "GNU General Public License," "Funding for
Free Software," and "Protect Your Freedom--Fight `Look And Feel'" are
included exactly as in the original, and provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that the sections entitled "GNU General Public
License," "Funding for Free Software," and "Protect Your Freedom--Fight
`Look And Feel'", and this permission notice, may be included in
translations approved by the Free Software Foundation instead of in the
original English.
File: gcc.info, Node: Bug Reporting, Next: Sending Patches, Prev: Bug Lists, Up: Bugs
How to Report Bugs
==================
The fundamental principle of reporting bugs usefully is this:
*report all the facts*. If you are not sure whether to state a fact or
leave it out, state it!
Often people omit facts because they think they know what causes the
problem and they conclude that some details don't matter. Thus, you
might assume that the name of the variable you use in an example does
not matter. Well, probably it doesn't, but one cannot be sure.
Perhaps the bug is a stray memory reference which happens to fetch from
the location where that name is stored in memory; perhaps, if the name
were different, the contents of that location would fool the compiler
into doing the right thing despite the bug. Play it safe and give a
specific, complete example. That is the easiest thing for you to do,
and the most helpful.
Keep in mind that the purpose of a bug report is to enable someone to
fix the bug if it is not known. It isn't very important what happens if
the bug is already known. Therefore, always write your bug reports on
the assumption that the bug is not known.
Sometimes people give a few sketchy facts and ask, "Does this ring a
bell?" This cannot help us fix a bug, so it is basically useless. We
respond by asking for enough details to enable us to investigate. You
might as well expedite matters by sending them to begin with.
Try to make your bug report self-contained. If we have to ask you
for more information, it is best if you include all the previous
information in your response, as well as the information that was
missing.
Please report each bug in a separate message. This makes it easier
for us to track which bugs have been fixed and to forward your bugs
reports to the appropriate maintainer.
To enable someone to investigate the bug, you should include all
these things:
* The version of GNU CC. You can get this by running it with the
`-v' option.
Without this, we won't know whether there is any point in looking
for the bug in the current version of GNU CC.
* A complete input file that will reproduce the bug. If the bug is
in the C preprocessor, send a source file and any header files
that it requires. If the bug is in the compiler proper (`cc1'),
run your source file through the C preprocessor by doing `gcc -E
SOURCEFILE > OUTFILE', then include the contents of OUTFILE in the
bug report. (When you do this, use the same `-I', `-D' or `-U'
options that you used in actual compilation.)
A single statement is not enough of an example. In order to
compile it, it must be embedded in a complete file of compiler
input; and the bug might depend on the details of how this is done.
Without a real example one can compile, all anyone can do about
your bug report is wish you luck. It would be futile to try to
guess how to provoke the bug. For example, bugs in register
allocation and reloading frequently depend on every little detail
of the function they happen in.
Even if the input file that fails comes from a GNU program, you
should still send the complete test case. Don't ask the GNU CC
maintainers to do the extra work of obtaining the program in
question--they are all overworked as it is. Also, the problem may
depend on what is in the header files on your system; it is
unreliable for the GNU CC maintainers to try the problem with the
header files available to them. By sending CPP output, you can
eliminate this source of uncertainty and save us a certain
percentage of wild goose chases.
* The command arguments you gave GNU CC or GNU C++ to compile that
example and observe the bug. For example, did you use `-O'? To
guarantee you won't omit something important, list all the options.
If we were to try to guess the arguments, we would probably guess
wrong and then we would not encounter the bug.
* The type of machine you are using, and the operating system name
and version number.
* The operands you gave to the `configure' command when you installed
the compiler.
* A complete list of any modifications you have made to the compiler
source. (We don't promise to investigate the bug unless it
happens in an unmodified compiler. But if you've made
modifications and don't tell us, then you are sending us on a wild
goose chase.)
Be precise about these changes. A description in English is not
enough--send a context diff for them.
Adding files of your own (such as a machine description for a
machine we don't support) is a modification of the compiler source.
* Details of any other deviations from the standard procedure for
installing GNU CC.
* A description of what behavior you observe that you believe is
incorrect. For example, "The compiler gets a fatal signal," or,
"The assembler instruction at line 208 in the output is incorrect."
Of course, if the bug is that the compiler gets a fatal signal,
then one can't miss it. But if the bug is incorrect output, the
maintainer might not notice unless it is glaringly wrong. None of
us has time to study all the assembler code from a 50-line C
program just on the chance that one instruction might be wrong.
We need *you* to do this part!
Even if the problem you experience is a fatal signal, you should
still say so explicitly. Suppose something strange is going on,
such as, your copy of the compiler is out of synch, or you have
encountered a bug in the C library on your system. (This has
happened!) Your copy might crash and the copy here would not. If
you said to expect a crash, then when the compiler here fails to
crash, we would know that the bug was not happening. If you don't
say to expect a crash, then we would not know whether the bug was
happening. We would not be able to draw any conclusion from our
observations.
If the problem is a diagnostic when compiling GNU CC with some
other compiler, say whether it is a warning or an error.
Often the observed symptom is incorrect output when your program
is run. Sad to say, this is not enough information unless the
program is short and simple. None of us has time to study a large
program to figure out how it would work if compiled correctly,
much less which line of it was compiled wrong. So you will have
to do that. Tell us which source line it is, and what incorrect
result happens when that line is executed. A person who
understands the program can find this as easily as finding a bug
in the program itself.