This is the mail archive of the gcc-bugs@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]

[Bug debug/12103] New: -g only crash (segfault) with a forward declared class used as a template parameter


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12103

           Summary: -g only crash (segfault) with a forward declared class
                    used as a template parameter
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ritzert at t-online dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu

The backtrace from cc1plus 
 
#0  0x083d1f3b in host_integerp (t=0x0, pos=0) 
    at /home/ritzert/gcc/HEAD/gcc/gcc/tree.c:3257 
#1  0x083d1fd9 in tree_low_cst (t=0x0, pos=0) 
    at /home/ritzert/gcc/HEAD/gcc/gcc/tree.c:3275 
#2  0x081db313 in add_data_member_location_attribute (die=0x401b0050, 
    decl=0x401a9e40) at /home/ritzert/gcc/HEAD/gcc/gcc/dwarf2out.c:9014 
#3  0x081e1574 in gen_inheritance_die (binfo=0x401a9e40, access=0x0, 
    context_die=0x401b0028) at 
/home/ritzert/gcc/HEAD/gcc/gcc/dwarf2out.c:11191 
 
shows that BINFO_VPTR_FIELD (decl) is 0 in add_data_member_location_attribute. 
 
The stripped down testcase: 
template<class T> 
class foo 
{ 
    T data_; 
}; 
 
class bar; 
typedef foo< bar > foobar; 
 
class obj 
{ 
  virtual foobar* yeah() = 0; 
}; 
 
class bar : virtual public obj 
{ 
}; 
 
gcc version 3.4 20030827 (experimental) 
 
The above code compiles 
- with gcc version 3.3.2 20030812 (Debian prerelease) 
- or without -g


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