Bug 38322 - ICE in gcc.dg/cpp/trad/include.c -fno-show-column at -m32 and -m64
Summary: ICE in gcc.dg/cpp/trad/include.c -fno-show-column at -m32 and -m64
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: preprocessor (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2008-11-30 02:38 UTC by Jack Howarth
Modified: 2010-03-10 03:47 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-01-02 17:09:50


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jack Howarth 2008-11-30 02:38:04 UTC
The gcc.dg/cpp/trad/include.c -fno-show-column compilation test ICEs with...

/sw/src/fink.build/gcc44-4.3.999-20081129/darwin_objdir/gcc/xgcc -B/sw/src/fink.build/gcc44-4.3.999-20081129/darwin_objdir/gcc/ /sw/src/fink.build/gcc44-4.3.999-20081129/gcc-4.4-20081129/gcc/testsuite/gcc.dg/cpp/trad/include.c  -fno-show-column  -traditional-cpp -E  -m32 -o include.i 
<built-in>:0: internal compiler error: Abort trap
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

No luck so far in getting a backtrace. Same error at -m64.
Comment 1 Andrew Pinski 2008-12-01 00:17:16 UTC
I had the same thing for the PS3 compiler, it turned out due to C++ style comments in the system headers.  This was causing libcpp to abort.
Comment 2 Jack Howarth 2008-12-01 14:23:40 UTC
I don't see any c++ comments in the included system headers. Is there a way in gcc to dump the preprocessed source in a manner that won't parse out the comments? When I dropped the '-fno-show-column  -traditional-cpp' flags, the abort was eliminated but the resulting include.i is missing the comments. A manual search of the system headers didn't show any but it would be nice to be able to verify through gcc.
Comment 3 Tom Tromey 2009-01-02 16:44:56 UTC
You can try -C to keep the comments.

In the original report you said you can't get a backtrace.
That makes it a lot harder :(

Could you try shrinking the test case somehow?
Or perhaps you could change the abort() calls in libcpp to something
that would print __FILE__ and __LINE__.  That might help a little.
Comment 4 Andrew Pinski 2009-01-02 17:09:50 UTC
Here is a reduced testcase:
t.c:

#include <t.h>


--- CUT ---
t.h:

#ifdef __PME__

#define _TLS_QUAL /*0123456790*/

#endif // __PME__

Compile with "gcc t.c -isystem . -traditional-cpp".

Comment 5 Andrew Pinski 2009-01-02 17:11:11 UTC
I can reproduce the abort on both i686-linux-gnu and i386-darwin8.11 with my reduced testcase.
Comment 6 Jack Howarth 2009-01-02 22:40:23 UTC
The test case from Comment 4 triggers the error on x86_64-apple-darwin10 as well.
Comment 7 Jack Howarth 2009-02-21 20:18:12 UTC
This problem in darwin10 is in fact due to c++ comments in /usr/include/Availability.h  and /usr/include/AvailabilityInternal.h. Replacing those with c style comments allows the gcc.dg/cpp/trad/include.c -fno-show-column testcase to pass without ICE'ing.
Comment 8 Jack Howarth 2010-03-10 03:47:35 UTC
This bug is fixed for the release Mac OS X 10.6 (ie the c++ comments are removed from /usr/include/Availability.h  and /usr/include/AvailabilityInternal.h.