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