This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH to pushtag for template crash
>>>>> "Jason" == Jason Merrill <jason@cygnus.com> writes:
>>>>> Mark Mitchell <mark@markmitchell.com> writes:
>> Jason, the patch disables debug-generation for *all* of these
>> TYPE_DECLs, not just the template version.
Jason> This sounds very wrong; the debugging backends use those
Jason> stub _decls to control emitting debugging information for
Jason> class types. If you set DECL_IGNORED_P on the stubs, none
Jason> of the classes will have debugging information emitted.
Good thing I asked. I put this in instead.
--
Mark Mitchell mark@markmitchell.com
Mark Mitchell Consulting http://www.markmitchell.com
1998-07-19 Mark Mitchell <mark@markmitchell.com>
* decl.c (pushtag): Revert previous change.
* pt.c (lookup_template_class): Don't put out debugging
information for types that use template parameters.
Index: decl.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl.c,v
retrieving revision 1.163
diff -c -p -r1.163 decl.c
*** decl.c 1998/07/19 18:00:45 1.163
--- decl.c 1998/07/20 01:48:37
*************** pushtag (name, type, globalize)
*** 2287,2300 ****
if (current_lang_name == lang_name_java)
TYPE_FOR_JAVA (type) = 1;
SET_DECL_ARTIFICIAL (d);
- /* There's no reason to put out debugging information
- for these declarations since they are
- compiler-generated. Furthermore, if the type makes
- use of template parameters, the code that generates
- debugging information will get confused. It is safe
- to put these out in the non-template case, just
- useless. */
- DECL_IGNORED_P (d) = 1;
if (! in_class)
set_identifier_type_value_with_scope (name, type, b);
}
--- 2287,2292 ----
Index: pt.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/pt.c,v
retrieving revision 1.166
diff -c -p -r1.166 pt.c
*** pt.c 1998/07/17 16:29:25 1.166
--- pt.c 1998/07/20 01:48:56
*************** lookup_template_class (d1, arglist, in_d
*** 3212,3217 ****
--- 3212,3222 ----
&& CLASSTYPE_INTERFACE_KNOWN (TREE_TYPE (template))
&& ! CLASSTYPE_INTERFACE_ONLY (TREE_TYPE (template)))
add_pending_template (t);
+
+ if (uses_template_parms (arglist))
+ /* If the type makes use of template parameters, the
+ code that generates debugging information will crash. */
+ DECL_IGNORED_P (TYPE_STUB_DECL (t)) = 1;
}
return t;