bugreport.texi 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. @c Copyright (C) 1988-2015 Free Software Foundation, Inc.
  2. @c This is part of the GCC manual.
  3. @c For copying conditions, see the file gcc.texi.
  4. @node Bugs
  5. @chapter Reporting Bugs
  6. @cindex bugs
  7. @cindex reporting bugs
  8. Your bug reports play an essential role in making GCC reliable.
  9. When you encounter a problem, the first thing to do is to see if it is
  10. already known. @xref{Trouble}. If it isn't known, then you should
  11. report the problem.
  12. @menu
  13. * Criteria: Bug Criteria. Have you really found a bug?
  14. * Reporting: Bug Reporting. How to report a bug effectively.
  15. @end menu
  16. @node Bug Criteria
  17. @section Have You Found a Bug?
  18. @cindex bug criteria
  19. If you are not sure whether you have found a bug, here are some guidelines:
  20. @itemize @bullet
  21. @cindex fatal signal
  22. @cindex core dump
  23. @item
  24. If the compiler gets a fatal signal, for any input whatever, that is a
  25. compiler bug. Reliable compilers never crash.
  26. @cindex invalid assembly code
  27. @cindex assembly code, invalid
  28. @item
  29. If the compiler produces invalid assembly code, for any input whatever
  30. (except an @code{asm} statement), that is a compiler bug, unless the
  31. compiler reports errors (not just warnings) which would ordinarily
  32. prevent the assembler from being run.
  33. @cindex undefined behavior
  34. @cindex undefined function value
  35. @cindex increment operators
  36. @item
  37. If the compiler produces valid assembly code that does not correctly
  38. execute the input source code, that is a compiler bug.
  39. However, you must double-check to make sure, because you may have a
  40. program whose behavior is undefined, which happened by chance to give
  41. the desired results with another C or C++ compiler.
  42. For example, in many nonoptimizing compilers, you can write @samp{x;}
  43. at the end of a function instead of @samp{return x;}, with the same
  44. results. But the value of the function is undefined if @code{return}
  45. is omitted; it is not a bug when GCC produces different results.
  46. Problems often result from expressions with two increment operators,
  47. as in @code{f (*p++, *p++)}. Your previous compiler might have
  48. interpreted that expression the way you intended; GCC might
  49. interpret it another way. Neither compiler is wrong. The bug is
  50. in your code.
  51. After you have localized the error to a single source line, it should
  52. be easy to check for these things. If your program is correct and
  53. well defined, you have found a compiler bug.
  54. @item
  55. If the compiler produces an error message for valid input, that is a
  56. compiler bug.
  57. @cindex invalid input
  58. @item
  59. If the compiler does not produce an error message for invalid input,
  60. that is a compiler bug. However, you should note that your idea of
  61. ``invalid input'' might be someone else's idea of ``an extension'' or
  62. ``support for traditional practice''.
  63. @item
  64. If you are an experienced user of one of the languages GCC supports, your
  65. suggestions for improvement of GCC are welcome in any case.
  66. @end itemize
  67. @node Bug Reporting
  68. @section How and Where to Report Bugs
  69. @cindex compiler bugs, reporting
  70. Bugs should be reported to the bug database at @value{BUGURL}.