Comment 13 for bug 647597

Revision history for this message
Yao Qi (yao-codesourcery) wrote :

I get a reduced test case for this bug. Attached here.

segv fault is cause by following code snip in cp/mangle.c

static tree
mangle_decl_string (const tree decl)
{
...
   input_location = DECL_SOURCE_LOCATION (decl); // input_location is ZERO
...
   write_mangled_name (decl, true); // Segv fault is triggers in child
calls.
}

This piece of code is backported from gcc 4.5 to fix GCC PR42748,
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42748

The decl is __PRETTY_FUNCTION__, and input_location on FSF 4.5 is NOT
zero. DECL_SOURCE_LOCATION should return non-zero value for
__PRETTY_FUNCTION__, so that it could be mangled.

Still investigating it.