This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: PATCH: fix PR debug/11325


hi Rainer -

>this patch broke bootstrap on mips-sgi-irix6.5:

Bother.
The culprit was here:

#ifdef MIPS_DEBUGGING_INFO
  /* The SGI compilers handle arrays of unknown bound by setting
     AT_declaration and not emitting any subrange DIEs.  */
  if (! TYPE_DOMAIN (type))
    add_AT_unsigned (array_die, DW_AT_declaration, 1);
  else
#endif


where here the `declaration' attribute is being added with a constant
type.  Everywhere else, this attribute is assumed to be a flag (boolean);
this is what the dwarf-2 specification says it should be.

If you try to get a flag attribute using get_AT_flag, but the attribute
was actually created with add_AT_unsigned, then you'll get this crash.

I guess no one was looking at the declaration attribute for these dies
before...

I tried to fix it so that the correct type for declaration is used,
as in the patch below.  That seemed to fix the immediate problem ---
the boostrap got past the point where it crashed before.  My bootstrap
is still running, but i have to leave for the night soon,
so i thought i should go ahead and send this.
sss


2003-11-18  Scott Snyder  <snyder@fnal.gov>

	* dwarf2out.c (gen_array_type_die): DW_AT_declaration should be a
	flag, not a constant.

Index: dwarf2out.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.463
diff -u -p -r1.463 dwarf2out.c
--- dwarf2out.c	17 Nov 2003 17:48:59 -0000	1.463
+++ dwarf2out.c	19 Nov 2003 02:43:43 -0000
@@ -10200,7 +10200,7 @@ gen_array_type_die (tree type, dw_die_re
   /* The SGI compilers handle arrays of unknown bound by setting
      AT_declaration and not emitting any subrange DIEs.  */
   if (! TYPE_DOMAIN (type))
-    add_AT_unsigned (array_die, DW_AT_declaration, 1);
+    add_AT_flag (array_die, DW_AT_declaration, 1);
   else
 #endif
     add_subscript_info (array_die, type);


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