GCC 2.96 20000621 ICE in dbxout.c (Possible fix included)

Raja R Harinath harinath@cs.umn.edu
Wed Jun 21 17:48:00 GMT 2000


Hi,

The attached file causes gcc to ICE.

  $ ./xgcc -v
  Reading specs from /home/grad04/harinath/linux/lib/gcc-lib/i686-pc-linux/2.96/specs
  gcc version 2.96 20000621 (experimental)

  $ ./cc1 -g -O2 -fPIC test.c
  [snip]
  test.c: In function `g_printf_string_upper_bound':
  test.c:5053: Tree check: expected field_decl, have var_decl
  test.c:5053: Internal compiler error in `dbxout_symbol', at dbxout.c:1941
  Please submit a full bug report.
  See <URL: http://www.gnu.org/software/gcc/bugs.html > for instructions.

The code in dbxout looks like:

  switch (TREE_CODE (decl))
  ...
  case VAR_DECL:
  ...
       && (DECL_FIELD_CONTEXT (decl) == NULL_TREE
  ...

Since it is inside the VAR_DECL case, that code will probably never
get a field_decl.

The following fix allows the compile to succeed (though I'm not sure
if this is the right fix):

  Index: dbxout.c
  ===================================================================
  RCS file: /cvs/gcc/egcs/gcc/dbxout.c,v
  retrieving revision 1.57
  diff -u -p -u -r1.57 dbxout.c
  --- dbxout.c	2000/06/08 14:33:04	1.57
  +++ dbxout.c	2000/06/22 00:24:10
  @@ -1938,8 +1938,8 @@ dbxout_symbol (decl, local)
            && DECL_INITIAL (decl) != 0
            && host_integerp (DECL_INITIAL (decl), 0)
            && ! TREE_ASM_WRITTEN (decl)
  -	  && (DECL_FIELD_CONTEXT (decl) == NULL_TREE
  -	      || TREE_CODE (DECL_FIELD_CONTEXT (decl)) == BLOCK))
  +	  && (DECL_CONTEXT (decl) == NULL_TREE
  +	      || TREE_CODE (DECL_CONTEXT (decl)) == BLOCK))
          {
            if (TREE_PUBLIC (decl) == 0)
              {

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c.bz2
Type: application/x-bzip2
Size: 24197 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20000621/a9a8f071/attachment.bz2>


More information about the Gcc-bugs mailing list