This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Don't emit debug info for mudflap artificial vars/functions (PR debug/34535)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>, Mark Mitchell <mark at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Alexandre Oliva <aoliva at redhat dot com>
- Date: Thu, 20 Dec 2007 05:27:50 -0500
- Subject: [PATCH] Don't emit debug info for mudflap artificial vars/functions (PR debug/34535)
- References: <20071220101153.GA20451@devserv.devel.redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Dec 20, 2007 at 05:11:53AM -0500, Jakub Jelinek wrote:
> A bunch of mudflap C++ tests fail since cp_classify_record langhook
> has been added. The problem is that tree-mudflap.c types don't have
> TYPE_LANG_SPECIFIC set and as CLASSTYPE_DECLARED_CLASS is a bit
> in lang_type_class, cp_classify_record ICEs. While arguably tree-mudflap.c
> should be probably changed to make all its stuff DECL_ARTIFICIAL and
> DECL_IGNORED_P, a langhook that is passed arbitrary RECORD_TYPEs should
> be a little bit more careful.
And this patch changes tree-mudflap.c not to emit debug info for its __mf_*
artificial stuff. This fixes the libmudflap ICEs as well.
IMHO both patches are desirable, but if you disagree with that, either of
the patches is sufficient.
2007-12-20 Jakub Jelinek <jakub@redhat.com>
PR debug/34535
* tree-mudflap.c (mf_make_builtin): Make decl artificial
and don't emit debug info for it.
--- gcc/tree-mudflap.c.jj 2007-08-13 15:11:18.000000000 +0200
+++ gcc/tree-mudflap.c 2007-12-20 11:15:01.000000000 +0100
@@ -301,6 +301,10 @@ mf_make_builtin (enum tree_code category
TREE_PUBLIC (decl) = 1;
DECL_EXTERNAL (decl) = 1;
lang_hooks.decls.pushdecl (decl);
+ /* The decl was declared by the compiler. */
+ DECL_ARTIFICIAL (decl) = 1;
+ /* And we don't want debug info for it. */
+ DECL_IGNORED_P (decl) = 1;
return decl;
}
Jakub