| 1 |
|
|---|
| 2 | GCC Bugs
|
|---|
| 3 |
|
|---|
| 4 | The latest version of this document is always available at
|
|---|
| 5 | [1]http://gcc.gnu.org/bugs.html.
|
|---|
| 6 | _________________________________________________________________
|
|---|
| 7 |
|
|---|
| 8 | Table of Contents
|
|---|
| 9 |
|
|---|
| 10 | * [2]Reporting Bugs
|
|---|
| 11 | + [3]What we need
|
|---|
| 12 | + [4]What we DON'T want
|
|---|
| 13 | + [5]Where to post it
|
|---|
| 14 | + [6]Detailed bug reporting instructions
|
|---|
| 15 | + [7]Detailed bug reporting instructions for GNAT
|
|---|
| 16 | + [8]Detailed bug reporting instructions when using a
|
|---|
| 17 | precompiled header
|
|---|
| 18 | * [9]Frequently Reported Bugs in GCC
|
|---|
| 19 | + [10]C++
|
|---|
| 20 | o [11]Missing features
|
|---|
| 21 | o [12]Bugs fixed in the 3.4 series
|
|---|
| 22 | + [13]Fortran
|
|---|
| 23 | * [14]Non-bugs
|
|---|
| 24 | + [15]General
|
|---|
| 25 | + [16]C
|
|---|
| 26 | + [17]C++
|
|---|
| 27 | o [18]Common problems when upgrading the compiler
|
|---|
| 28 | _________________________________________________________________
|
|---|
| 29 |
|
|---|
| 30 | Reporting Bugs
|
|---|
| 31 |
|
|---|
| 32 | The main purpose of a bug report is to enable us to fix the bug. The
|
|---|
| 33 | most important prerequisite for this is that the report must be
|
|---|
| 34 | complete and self-contained, which we explain in detail below.
|
|---|
| 35 |
|
|---|
| 36 | Before you report a bug, please check the [19]list of well-known bugs
|
|---|
| 37 | and, if possible in any way, try a current development snapshot. If
|
|---|
| 38 | you want to report a bug with versions of GCC before 3.1 we strongly
|
|---|
| 39 | recommend upgrading to the current release first.
|
|---|
| 40 |
|
|---|
| 41 | Before reporting that GCC compiles your code incorrectly, please
|
|---|
| 42 | compile it with gcc -Wall and see whether this shows anything wrong
|
|---|
| 43 | with your code that could be the cause instead of a bug in GCC.
|
|---|
| 44 |
|
|---|
| 45 | Summarized bug reporting instructions
|
|---|
| 46 |
|
|---|
| 47 | After this summary, you'll find detailed bug reporting instructions,
|
|---|
| 48 | that explain how to obtain some of the information requested in this
|
|---|
| 49 | summary.
|
|---|
| 50 |
|
|---|
| 51 | What we need
|
|---|
| 52 |
|
|---|
| 53 | Please include in your bug report all of the following items, the
|
|---|
| 54 | first three of which can be obtained from the output of gcc -v:
|
|---|
| 55 | * the exact version of GCC;
|
|---|
| 56 | * the system type;
|
|---|
| 57 | * the options given when GCC was configured/built;
|
|---|
| 58 | * the complete command line that triggers the bug;
|
|---|
| 59 | * the compiler output (error messages, warnings, etc.); and
|
|---|
| 60 | * the preprocessed file (*.i*) that triggers the bug, generated by
|
|---|
| 61 | adding -save-temps to the complete compilation command, or, in the
|
|---|
| 62 | case of a bug report for the GNAT front end, a complete set of
|
|---|
| 63 | source files (see below).
|
|---|
| 64 |
|
|---|
| 65 | What we do not want
|
|---|
| 66 |
|
|---|
| 67 | * A source file that #includes header files that are left out of the
|
|---|
| 68 | bug report (see above)
|
|---|
| 69 | * That source file and a collection of header files.
|
|---|
| 70 | * An attached archive (tar, zip, shar, whatever) containing all (or
|
|---|
| 71 | some :-) of the above.
|
|---|
| 72 | * A code snippet that won't cause the compiler to produce the exact
|
|---|
| 73 | output mentioned in the bug report (e.g., a snippet with just a
|
|---|
| 74 | few lines around the one that apparently triggers the bug, with
|
|---|
| 75 | some pieces replaced with ellipses or comments for extra
|
|---|
| 76 | obfuscation :-)
|
|---|
| 77 | * The location (URL) of the package that failed to build (we won't
|
|---|
| 78 | download it, anyway, since you've already given us what we need to
|
|---|
| 79 | duplicate the bug, haven't you? :-)
|
|---|
| 80 | * An error that occurs only some of the times a certain file is
|
|---|
| 81 | compiled, such that retrying a sufficient number of times results
|
|---|
| 82 | in a successful compilation; this is a symptom of a hardware
|
|---|
| 83 | problem, not of a compiler bug (sorry)
|
|---|
| 84 | * E-mail messages that complement previous, incomplete bug reports.
|
|---|
| 85 | Post a new, self-contained, full bug report instead, if possible
|
|---|
| 86 | as a follow-up to the original bug report
|
|---|
| 87 | * Assembly files (*.s) produced by the compiler, or any binary
|
|---|
| 88 | files, such as object files, executables, core files, or
|
|---|
| 89 | precompiled header files
|
|---|
| 90 | * Duplicate bug reports, or reports of bugs already fixed in the
|
|---|
| 91 | development tree, especially those that have already been reported
|
|---|
| 92 | as fixed last week :-)
|
|---|
| 93 | * Bugs in the assembler, the linker or the C library. These are
|
|---|
| 94 | separate projects, with separate mailing lists and different bug
|
|---|
| 95 | reporting procedures
|
|---|
| 96 | * Bugs in releases or snapshots of GCC not issued by the GNU
|
|---|
| 97 | Project. Report them to whoever provided you with the release
|
|---|
| 98 | * Questions about the correctness or the expected behavior of
|
|---|
| 99 | certain constructs that are not GCC extensions. Ask them in forums
|
|---|
| 100 | dedicated to the discussion of the programming language
|
|---|
| 101 |
|
|---|
| 102 | Where to post it
|
|---|
| 103 |
|
|---|
| 104 | Please submit your bug report directly to the [20]GCC bug database.
|
|---|
| 105 | Alternatively, you can use the gccbug script that mails your bug
|
|---|
| 106 | report to the bug database.
|
|---|
| 107 | Only if all this is absolutely impossible, mail all information to
|
|---|
| 108 | [21][email protected].
|
|---|
| 109 |
|
|---|
| 110 | Detailed bug reporting instructions
|
|---|
| 111 |
|
|---|
| 112 | Please refer to the [22]next section when reporting bugs in GNAT, the
|
|---|
| 113 | Ada compiler, or to the [23]one after that when reporting bugs that
|
|---|
| 114 | appear when using a precompiled header.
|
|---|
| 115 |
|
|---|
| 116 | In general, all the information we need can be obtained by collecting
|
|---|
| 117 | the command line below, as well as its output and the preprocessed
|
|---|
| 118 | file it generates.
|
|---|
| 119 |
|
|---|
| 120 | gcc -v -save-temps all-your-options source-file
|
|---|
| 121 |
|
|---|
| 122 | Typically the preprocessed file (extension .i for C or .ii for C++,
|
|---|
| 123 | and .f if the preprocessor is used on Fortran files) will be large, so
|
|---|
| 124 | please compress the resulting file with one of the popular compression
|
|---|
| 125 | programs such as bzip2, gzip, zip or compress (in decreasing order of
|
|---|
| 126 | preference). Use maximum compression (-9) if available. Please include
|
|---|
| 127 | the compressed preprocessor output in your bug report, even if the
|
|---|
| 128 | source code is freely available elsewhere; it makes the job of our
|
|---|
| 129 | volunteer testers much easier.
|
|---|
| 130 |
|
|---|
| 131 | The only excuses to not send us the preprocessed sources are (i) if
|
|---|
| 132 | you've found a bug in the preprocessor, (ii) if you've reduced the
|
|---|
| 133 | testcase to a small file that doesn't include any other file or (iii)
|
|---|
| 134 | if the bug appears only when using precompiled headers. If you can't
|
|---|
| 135 | post the preprocessed sources because they're proprietary code, then
|
|---|
| 136 | try to create a small file that triggers the same problem.
|
|---|
| 137 |
|
|---|
| 138 | Since we're supposed to be able to re-create the assembly output
|
|---|
| 139 | (extension .s), you usually should not include it in the bug report,
|
|---|
| 140 | although you may want to post parts of it to point out assembly code
|
|---|
| 141 | you consider to be wrong.
|
|---|
| 142 |
|
|---|
| 143 | Whether to use MIME attachments or uuencode is up to you. In any case,
|
|---|
| 144 | make sure the compiler command line, version and error output are in
|
|---|
| 145 | plain text, so that we don't have to decode the bug report in order to
|
|---|
| 146 | tell who should take care of it. A meaningful subject indicating
|
|---|
| 147 | language and platform also helps.
|
|---|
| 148 |
|
|---|
| 149 | Please avoid posting an archive (.tar, .shar or .zip); we generally
|
|---|
| 150 | need just a single file to reproduce the bug (the .i/.ii/.f
|
|---|
| 151 | preprocessed file), and, by storing it in an archive, you're just
|
|---|
| 152 | making our volunteers' jobs harder. Only when your bug report requires
|
|---|
| 153 | multiple source files to be reproduced should you use an archive. This
|
|---|
| 154 | is, for example, the case if you are using INCLUDE directives in
|
|---|
| 155 | Fortran code, which are not processed by the preprocessor, but the
|
|---|
| 156 | compiler. In that case, we need the main file and all INCLUDEd files.
|
|---|
| 157 | In any case, make sure the compiler version, error message, etc, are
|
|---|
| 158 | included in the body of your bug report as plain text, even if
|
|---|
| 159 | needlessly duplicated as part of an archive.
|
|---|
| 160 |
|
|---|
| 161 | If you fail to supply enough information for a bug report to be
|
|---|
| 162 | reproduced, someone will probably ask you to post additional
|
|---|
| 163 | information (or just ignore your bug report, if they're in a bad day,
|
|---|
| 164 | so try to get it right on the first posting :-). In this case, please
|
|---|
| 165 | post the additional information to the bug reporting mailing list, not
|
|---|
| 166 | just to the person who requested it, unless explicitly told so. If
|
|---|
| 167 | possible, please include in this follow-up all the information you had
|
|---|
| 168 | supplied in the incomplete bug report (including the preprocessor
|
|---|
| 169 | output), so that the new bug report is self-contained.
|
|---|
| 170 |
|
|---|
| 171 | Detailed bug reporting instructions for GNAT
|
|---|
| 172 |
|
|---|
| 173 | See the [24]previous section for bug reporting instructions for GCC
|
|---|
| 174 | language implementations other than Ada.
|
|---|
| 175 |
|
|---|
| 176 | Bug reports have to contain at least the following information in
|
|---|
| 177 | order to be useful:
|
|---|
| 178 | * the exact version of GCC, as shown by "gcc -v";
|
|---|
| 179 | * the system type;
|
|---|
| 180 | * the options when GCC was configured/built;
|
|---|
| 181 | * the exact command line passed to the gcc program triggering the
|
|---|
| 182 | bug (not just the flags passed to gnatmake, but gnatmake prints
|
|---|
| 183 | the parameters it passed to gcc)
|
|---|
| 184 | * a collection of source files for reproducing the bug, preferably a
|
|---|
| 185 | minimal set (see below);
|
|---|
| 186 | * a description of the expected behavior;
|
|---|
| 187 | * a description of actual behavior.
|
|---|
| 188 |
|
|---|
| 189 | If your code depends on additional source files (usually package
|
|---|
| 190 | specifications), submit the source code for these compilation units in
|
|---|
| 191 | a single file that is acceptable input to gnatchop, i.e. contains no
|
|---|
| 192 | non-Ada text. If the compilation terminated normally, you can usually
|
|---|
| 193 | obtain a list of dependencies using the "gnatls -d main_unit" command,
|
|---|
| 194 | where main_unit is the file name of the main compilation unit (which
|
|---|
| 195 | is also passed to gcc).
|
|---|
| 196 |
|
|---|
| 197 | If you report a bug which causes the compiler to print a bug box,
|
|---|
| 198 | include that bug box in your report, and do not forget to send all the
|
|---|
| 199 | source files listed after the bug box along with your report.
|
|---|
| 200 |
|
|---|
| 201 | If you use gnatprep, be sure to send in preprocessed sources (unless
|
|---|
| 202 | you have to report a bug in gnatprep).
|
|---|
| 203 |
|
|---|
| 204 | When you have checked that your report meets these criteria, please
|
|---|
| 205 | submit it according to our [25]generic instructions. (If you use a
|
|---|
| 206 | mailing list for reporting, please include an "[Ada]" tag in the
|
|---|
| 207 | subject.)
|
|---|
| 208 |
|
|---|
| 209 | Detailed bug reporting instructions when using a precompiled header
|
|---|
| 210 |
|
|---|
|
|---|