gcc: Bug Criteria
1
1 14.1 Have You Found a Bug?
1 ==========================
1
1 If you are not sure whether you have found a bug, here are some
1 guidelines:
1
1 * If the compiler gets a fatal signal, for any input whatever, that
1 is a compiler bug. Reliable compilers never crash.
1
1 * If the compiler produces invalid assembly code, for any input
1 whatever (except an 'asm' statement), that is a compiler bug,
1 unless the compiler reports errors (not just warnings) which would
1 ordinarily prevent the assembler from being run.
1
1 * If the compiler produces valid assembly code that does not
1 correctly execute the input source code, that is a compiler bug.
1
1 However, you must double-check to make sure, because you may have a
1 program whose behavior is undefined, which happened by chance to
1 give the desired results with another C or C++ compiler.
1
1 For example, in many nonoptimizing compilers, you can write 'x;' at
1 the end of a function instead of 'return x;', with the same
1 results. But the value of the function is undefined if 'return' is
1 omitted; it is not a bug when GCC produces different results.
1
1 Problems often result from expressions with two increment
1 operators, as in 'f (*p++, *p++)'. Your previous compiler might
1 have interpreted that expression the way you intended; GCC might
1 interpret it another way. Neither compiler is wrong. The bug is
1 in your code.
1
1 After you have localized the error to a single source line, it
1 should be easy to check for these things. If your program is
1 correct and well defined, you have found a compiler bug.
1
1 * If the compiler produces an error message for valid input, that is
1 a compiler bug.
1
1 * If the compiler does not produce an error message for invalid
1 input, that is a compiler bug. However, you should note that your
1 idea of "invalid input" might be someone else's idea of "an
1 extension" or "support for traditional practice".
1
1 * If you are an experienced user of one of the languages GCC
1 supports, your suggestions for improvement of GCC are welcome in
1 any case.
1