This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/12500] stabs debug info -- void no longer a predefined / builtin type
- From: David Taylor <dtaylor at emc dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 21 Oct 2003 14:53:56 -0400
- Subject: [Bug debug/12500] stabs debug info -- void no longer a predefined / builtin type
[drow at mvista dot com requested that I send this to gcc-patches.
This is already filed in the gcc bug database as debug/12500.
This is a regression relative to (at least) 2.95.3.]
[Observed in i686-pc-linux-gnu native and i686-pc-linux-gnu x powerpc-elf-eabi;
but problem is really configuration independent.]
Pick your favorite .c file, compile it with -gstabs -S, and examine
the output. At the top of the file you will find the stabs entries
for the predefined / builtin data types -- int, char, short, long,
et cetera. In 2.95.3, the list included 'void'; in 3.3.1, void is
absent. This causes subsequent errors in the debug information for
functions and variables that reference void.
The fix is a one liner -- file gcc/dbxout.c, function dbxout_typedefs,
change the line:
&& COMPLETE_TYPE_P (type)
to:
&& COMPLETE_OR_VOID_TYPE_P (type)
With this patch, it bootstraps just fine.
BTW, I consider my one line fix to be low risk because:
. it does not affect code generation for ANY targets, regardless of
the command line options
. it only affects stabs debug information
. the function modified is only called once; and it only produces one
additional line of stabs output -- a line of output that was present in
2.95.3.
. the compiler bootstraps just fine
. void was the only deletion; and it appears to have been done
accidentally as a side effect of another change (so, I believe that
putting it back is "the right fix").
. we are using it in house and it works
NOTE: The problem was initially observed internally using a locally
written stabs parser.
I believe that there were structs containing pointers to void and they
got mis-represented as either instances of non-existent types or self
referential types or some such.