source: trunk/src/gcc/bugs.html@ 9

Last change on this file since 9 was 2, checked in by bird, 23 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 26.8 KB
Line 
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://www.gnu.org/software/gcc/bugs.html">http://www.gnu.org/software/gcc/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="#manage">Managing Bugs (GNATS and the test-suite)</a></li>
28<li><a href="#known">Frequently Reported Bugs in GCC</a>
29 <ul>
30 <li><a href="#general">General</a></li>
31 <li><a href="#fortran">Fortran</a></li>
32 <li><a href="#c">C</a></li>
33 <li><a href="#cplusplus">C++</a>
34 <ul>
35 <li><a href="#updating">Common problems updating from G++ 2.95 to
36 G++ 3.0</a></li>
37 <li><a href="#nonbugs">Non-bugs</a></li>
38 <li><a href="#missing">Missing features</a></li>
39 <li><a href="#parsing">Parse errors for "simple" code</a></li>
40 <li><a href="#-O3">Optimization at <code>-O3</code> takes a
41 very long time</a></li>
42 </ul>
43 </li>
44 </ul>
45 </li>
46</ul>
47
48<hr />
49
50<h1><a name="report">Reporting Bugs</a></h1>
51
52<p>Our preferred way of receiving bugs is via the
53<a href="gnats.html">GCC GNATS bug reporting system</a>.</p>
54
55<p>Before you report a bug, please check the
56<a href="#known">list of well-known bugs</a> and, <strong>if possible
57in any way, try a current development snapshot</strong>.
58If you want to report a bug with versions of GCC before 3.1 we strongly
59recommend upgrading to the current release first.</p>
60
61<p>Before reporting that GCC compiles your code incorrectly, please
62compile it with <code>gcc -Wall</code> and see whether this shows
63anything wrong with your code that could be the cause instead of a bug
64in GCC.</p>
65
66<h2>Summarized bug reporting instructions</h2>
67
68<p>After this summary, you'll find detailed bug reporting
69instructions, that explain how to obtain some of the information
70requested in this summary.</p>
71
72<h3><a name="need">What we need</a></h3>
73
74Please include in your bug report all of the following items, the first
75three of which can be obtained from the output of <code>gcc -v</code>:
76
77<ul>
78 <li>the exact version of GCC;</li>
79 <li>the system type;</li>
80 <li>the options given when GCC was configured/built;</li>
81 <li>the complete command line that triggers the bug;</li>
82 <li>the compiler output (error messages, warnings, etc.); and</li>
83 <li>the <em>preprocessed</em> file (<code>*.i*</code>) that triggers the
84 bug, generated by adding <code>-save-temps</code> to the complete
85 compilation command, or, in the case of a bug report for the GNAT front end,
86 a complete set of source files (see below).</li>
87</ul>
88
89<h3><a name="dontwant">What we do <strong>not</strong> want</a></h3>
90
91<ul>
92 <li>A source file that <code>#include</code>s header files that are left
93 out of the bug report (see above)</li>
94
95 <li>That source file and a collection of header files.</li>
96
97 <li>An attached archive (tar, zip, shar, whatever) containing all
98 (or some :-) of the above.</li>
99
100 <li>A code snippet that won't cause the compiler to produce the
101 exact output mentioned in the bug report (e.g., a snippet with just
102 a few lines around the one that <b>apparently</b> triggers the bug,
103 with some pieces replaced with ellipses or comments for extra
104 obfuscation :-)</li>
105
106 <li>The location (URL) of the package that failed to build (we won't
107 download it, anyway, since you've already given us what we need to
108 duplicate the bug, haven't you? :-)</li>
109
110 <li>An error that occurs only some of the times a certain file is
111 compiled, such that retrying a sufficient number of times results in
112 a successful compilation; this is a symptom of a hardware problem,
113 not of a compiler bug (sorry)</li>
114
115 <li>E-mail messages that complement previous, incomplete bug
116 reports. Post a new, self-contained, full bug report instead, if
117 possible as a follow-up to the original bug report</li>
118
119 <li>Assembly files (<code>*.s</code>) produced by the compiler, or any
120 binary files, such as object files, executables, core files, or
121 precompiled header files</li>
122
123 <li>Duplicate bug reports, or reports of bugs already fixed in the
124 development tree, especially those that have already been reported
125 as fixed last week :-)</li>
126
127 <li>Bugs in the assembler, the linker or the C library. These are
128 separate projects, with separate mailing lists and different bug
129 reporting procedures</li>
130
131 <li>Bugs in releases or snapshots of GCC not issued by the GNU
132 Project. Report them to whoever provided you with the release</li>
133
134 <li>Questions about the correctness or the expected behavior of
135 certain constructs that are not GCC extensions. Ask them in forums
136 dedicated to the discussion of the programming language</li>
137</ul>
138
139<h3><a name="where">Where to post it</a></h3>
140
141<p>Please submit your bug report directly to the
142<a href="gnats.html">GCC GNATS bug database</a>.
143Only if this is not possible, mail all information to
144<a href="mailto:[email protected]">[email protected]</a> or
145<a href="mailto:[email protected]">[email protected]</a>.</p>
146
147<p>The GCC lists have message size limits (200 kbytes) and bug reports
148over those limits will currently be bounced. If your bug is larger
149than that, please post it using the <a href="gnats.html">GCC GNATS bug
150database</a>.</p>
151
152<h2><a name="detailed">Detailed bug reporting instructions</a></h2>
153
154<p>Please refer to the <a href="#gnat">next section</a> when reporting
155bugs in GNAT, the Ada compiler, or to the <a href="#pch">one after
156that</a> when reporting bugs that appear when using a precompiled header.</p>
157
158<p>In general, all the information we need can be obtained by
159collecting the command line below, as well as its output and the
160preprocessed file it generates.</p>
161
162<blockquote><code>gcc -v -save-temps <i>all-your-options
163source-file</i></code></blockquote>
164
165<p>Typically the preprocessed file (extension <code>.i</code> for C or
166<code>.ii</code> for C++) will be large, so please compress the
167resulting file with one of the popular compression programs such as
168bzip2, gzip, zip or compress (in
169decreasing order of preference). Use maximum compression
170(<code>-9</code>) if available. Please include the compressed
171preprocessor output in your bug report, even if the source code is
172freely available elsewhere; it makes the job of our volunteer testers
173much easier.</p>
174
175<p>The <b>only</b> excuses to not send us the preprocessed sources are
176(i) if you've found a bug in the preprocessor, (ii) if you've reduced
177the testcase to a small file that doesn't include any other file or
178(iii) if the bug appears only when using precompiled headers. If you
179can't post the preprocessed sources because they're proprietary code,
180then try to create a small file that triggers the same problem.</p>
181
182<p>Since we're supposed to be able to re-create the assembly output
183(extension <code>.s</code>), you usually should not include
184it in the bug report, although you may want to post parts of it to
185point out assembly code you consider to be wrong.</p>
186
187<p>Whether to use MIME attachments or <code>uuencode</code> is up to
188you. In any case, make sure the compiler command line, version and
189error output are in plain text, so that we don't have to decode the
190bug report in order to tell who should take care of it. A meaningful
191subject indicating language and platform also helps.</p>
192
193<p>Please avoid posting an archive (.tar, .shar or .zip); we generally
194need just a single file to reproduce the bug (the .i/.ii preprocessed
195file), and, by storing it in an archive, you're just making our
196volunteers' jobs harder. Only when your bug report requires multiple
197source files to be reproduced should you use an archive. In any case,
198make sure the compiler version, error message, etc, are included in
199the body of your bug report as plain text, even if needlessly
200duplicated as part of an archive.</p>
201
202<p>If you fail to supply enough information for a bug report to be
203reproduced, someone will probably ask you to post additional
204information (or just ignore your bug report, if they're in a bad day,
205so try to get it right on the first posting :-). In this case, please
206post the additional information to the bug reporting mailing list, not
207just to the person who requested it, unless explicitly told so. If
208possible, please include in this follow-up all the information you had
209supplied in the incomplete bug report (including the preprocessor
210output), so that the new bug report is self-contained.</p>
211
212<h2><a name="gnat">Detailed bug reporting instructions for GNAT</a></h2>
213
214<p>See the <a href="#detailed">previous section</a> for bug reporting
215instructions for GCC language implementations other than Ada.</p>
216
217<p>Bug reports have to contain at least the following information in
218order to be useful:</p>
219
220<ul>
221<li>the exact version of GCC, as shown by "<code>gcc -v</code>";</li>
222<li>the system type;</li>
223<li>the options when GCC was configured/built;</li>
224<li>the exact command line passed to the <code>gcc</code> program
225triggering the bug
226(not just the flags passed to <code>gnatmake</code>, but
227<code>gnatmake</code> prints the parameters it passed to <code>gcc</code>)</li>
228<li>a collection of source files for reproducing the bug,
229preferably a minimal set (see below);</li>
230<li>a description of the expected behavior;</li>
231<li>a description of actual behavior.</li>
232</ul>
233
234<p>If your code depends on additional source files (usually package
235specifications), submit the source code for these compilation units in
236a single file that is acceptable input to <code>gnatchop</code>,
237i.e. contains no non-Ada text. If the compilation terminated
238normally, you can usually obtain a list of dependencies using the
239"<code>gnatls -d <i>main_unit</i></code>" command, where
240<code><i>main_unit</i></code> is the file name of the main compilation
241unit (which is also passed to <code>gcc</code>).</p>
242
243<p>If you report a bug which causes the compiler to print a bug box,
244include that bug box in your report, and do not forget to send all the
245source files listed after the bug box along with your report.</p>
246
247<p>If you use <code>gnatprep</code>, be sure to send in preprocessed
248sources (unless you have to report a bug in <code>gnatprep</code>).</p>
249
250<p>When you have checked that your report meets these criteria, please
251submit it according to our <a href="#where">generic instructions</a>.
252(If you use a mailing list for reporting, please include an
253"<code>[Ada]</code>" tag in the subject.)</p>
254
255<h2><a name="pch">Detailed bug reporting instructions when using a
256precompiled header</a></h2>
257
258<p>If you're encountering a bug when using a precompiled header, the
259first thing to do is to delete the precompiled header, and try running
260the same GCC command again. If the bug happens again, the bug doesn't
261really involve precompiled headers, please report it without using
262them by following the instructions <a href="#detailed">above</a>.</p>
263
264<p>If you've found a bug while <i>building</i> a precompiled header
265(for instance, the compiler crashes), follow the usual instructions
266<a href="#detailed">above</a>.</p>
267
268<p>If you've found a real precompiled header bug, what we'll need to
269reproduce it is the sources to build the precompiled header (as a
270single <code>.i</code> file), the source file that uses the
271precompiled header, any other headers that source file includes, and