This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


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)
              {

demonstrate ICE


- Hari
-- 
Raja R Harinath ------------------------------ harinath@cs.umn.edu
"When all else fails, read the instructions."      -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing."   -- Roy L Ash

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]