This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/7788: g++-3.2 internal error: Segmentation fault
- From: Pop Sébastian <pop at gauvain dot u-strasbg dot fr>
- To: nathan at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org,jerrysiebe at mindspring dot com, nobody at gcc dot gnu dot org,gcc-gnats at gcc dot gnu dot org
- Cc: nathan at codesourcery dot com
- Date: Sun, 29 Sep 2002 11:08:53 +0200
- Subject: Re: c++/7788: g++-3.2 internal error: Segmentation fault
- References: <20020913203932.8332.qmail@sources.redhat.com>
On Fri, Sep 13, 2002 at 08:39:32PM -0000, nathan@gcc.gnu.org wrote:
> Synopsis: g++-3.2 internal error: Segmentation fault
>
> State-Changed-From-To: open->analyzed
> State-Changed-By: nathan
> State-Changed-When: Fri Sep 13 13:39:32 2002
> State-Changed-Why:
> confirmed as a regression
>
> http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7788
The problem comes from cp/rtti.c in unemitted_tinfo_decl_p ().
Associated patch with these changes is:
Date: Fri, 21 Jun 2002 12:20:51 +0100
From: Nathan Sidwell <nathan@codesourcery.com>
Organization: Codesourcery LLC
X-Accept-Language: en
To: jason@redhat.com
Cc: gcc-patches@gcc.org
Subject: [C++ PATCH]: Rework typeinfo objects
2002-06-20 Nathan Sidwell <nathan@codesourcery.com>
int
! tinfo_decl_p (t, data)
tree t;
void *data ATTRIBUTE_UNUSED;
{
! return TREE_CODE (t) == VAR_DECL
! && IDENTIFIER_GLOBAL_VALUE (DECL_NAME (t)) == (t)
! && TREE_TYPE (t) == tinfo_decl_type
! && TREE_TYPE (DECL_NAME (t));
}
Changed into
int
! unemitted_tinfo_decl_p (t, data)
tree t;
void *data ATTRIBUTE_UNUSED;
{
! if (/* It's a var decl */
! TREE_CODE (t) == VAR_DECL
! /* whos name points back to itself */
! && IDENTIFIER_GLOBAL_VALUE (DECL_NAME (t)) == t
! /* whos name's type is non-null */
! && TREE_TYPE (DECL_NAME (t))
! /* and whos type is a struct */
! && TREE_CODE (TREE_TYPE (t)) == RECORD_TYPE
! /* with a first field of our pseudo type info */
! && TREE_TYPE (TYPE_FIELDS (TREE_TYPE (t))) == ti_desc_type_node)
! return 1;
! return 0;
}
I rewrote the condition as :
int
unemitted_tinfo_decl_p (t, data)
tree t;
void *data ATTRIBUTE_UNUSED;
{
/* It's a var decl */
if (TREE_CODE (t) == VAR_DECL)
{
tree dnt = DECL_NAME (t);
/* whos name points back to itself */
if (IDENTIFIER_GLOBAL_VALUE (dnt) == t)
/* whos name's type is non-null */
if (TREE_TYPE (dnt))
{
tree ttt = TREE_TYPE (t);
/* and whos type is a struct */
if (TREE_CODE (ttt) == RECORD_TYPE)
{
tree tfttt = TYPE_FIELDS (ttt);
/* with a first field of our pseudo type info */
=> if (TREE_TYPE (tfttt) == ti_desc_type_node)
return 1;
}
}
}
return 0;
}
The problem is here => since tfttt is NULL in this bug-report example.
Nathan could you review this patch and the associated bug-report please?
Thanks,
Sebastian