public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/19811] New: g++ 4.0: ICE on vector delete of undefined class
@ 2005-02-08  5:02 gcc-bugzilla at gcc dot gnu dot org
  2005-02-08  5:14 ` [Bug c++/19811] [4.0 Regression] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2005-02-08  5:02 UTC (permalink / raw)
  To: gcc-bugs



g++ crashes on the (invalid) code below:

$ g++ -c x.cc
x.cc: In function 'void foo(void*)':
x.cc:4: error: invalid use of undefined type 'struct C'
x.cc:1: error: forward declaration of 'struct C'
x.cc:4: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
$

Here's where it's crashing:


Program received signal SIGSEGV, Segmentation fault.
lookup_member (xbasetype=0x0, name=0x40032bfc, protect=1, want_type=0 '\0')
    at /home/sss/gcc/gcc/gcc/cp/search.c:1202
1202      if (TREE_CODE (xbasetype) == TREE_BINFO)
(gdb) where
#0  lookup_member (xbasetype=0x0, name=0x40032bfc, protect=1, want_type=0 '\0')
    at /home/sss/gcc/gcc/gcc/cp/search.c:1202
#1  0x08127e05 in lookup_fnfields (xbasetype=0x40032bfc, name=0x40032bfc,
    protect=1073949692) at /home/sss/gcc/gcc/gcc/cp/search.c:1293
#2  0x080508fb in build_op_delete_call (code=171, addr=0x4008dea0,
    size=0x400251b0, global_p=0 '\0', placement=0x0)
    at /home/sss/gcc/gcc/gcc/cp/call.c:3936
#3  0x0811bf9c in build_x_delete (addr=0x40032bfc, which_delete=0,
    virtual_size=0x40032bfc) at /home/sss/gcc/gcc/gcc/cp/init.c:2661
#4  0x0811cc95 in build_vec_delete_1 (base=0x4008dea0, maxindex=0x4008dec0,
    type=Variable "type" is not available.
) at /home/sss/gcc/gcc/gcc/cp/init.c:2297
#5  0x0811cefc in build_vec_delete (base=0x4008dea0, maxindex=0x4008dec0,
    auto_delete_vec=sfk_deleting_destructor, use_global_delete=0)
    at /home/sss/gcc/gcc/gcc/cp/init.c:3029
#6  0x080f5cc0 in cp_parser_delete_expression (parser=0x400b6924)
    at /home/sss/gcc/gcc/gcc/cp/parser.c:5115
#7  0x080ee408 in cp_parser_unary_expression (parser=0x400b6924,
    address_p=0 '\0') at /home/sss/gcc/gcc/gcc/cp/parser.c:4665
#8  0x080ef3c8 in cp_parser_assignment_expression (parser=0x400b6924)
    at /home/sss/gcc/gcc/gcc/cp/parser.c:5317
#9  0x080f09e7 in cp_parser_expression (parser=0x400b6924)
    at /home/sss/gcc/gcc/gcc/cp/parser.c:5612
#10 0x080f0c97 in cp_parser_expression_statement (parser=0x400b6924,
) at /home/sss/gcc/gcc/gcc/cp/parser.c:6009
#11 0x080e964c in cp_parser_statement (parser=0x400b6924,
    in_statement_expr=0x0) at /home/sss/gcc/gcc/gcc/cp/parser.c:5893
#12 0x080e9fb1 in cp_parser_statement_seq_opt (parser=0x400b6924,
    in_statement_expr=0x0) at /home/sss/gcc/gcc/gcc/cp/parser.c:6075
#13 0x080ea0b5 in cp_parser_compound_statement (parser=0x400b6924,
    in_statement_expr=0x0, in_try=Variable "in_try" is not available.
) at /home/sss/gcc/gcc/gcc/cp/parser.c:6048
#14 0x080ea158 in cp_parser_ctor_initializer_opt_and_function_body (
    parser=0x400b6924) at /home/sss/gcc/gcc/gcc/cp/parser.c:11909
#15 0x080ea6c7 in cp_parser_function_definition_after_declarator (
    parser=0x400b6924, inline_p=0 '\0')
    at /home/sss/gcc/gcc/gcc/cp/parser.c:14755
#16 0x080f68e5 in cp_parser_init_declarator (parser=0x400b6924,
    decl_specifiers=0xbffff158, function_definition_allowed_p=1 '\001',
    member_p=0 '\0', declares_class_or_enum=Variable "declares_class_or_enum" is not available.
)
    at /home/sss/gcc/gcc/gcc/cp/parser.c:14700
#17 0x080f6ae9 in cp_parser_simple_declaration (parser=0x400b6924,
    function_definition_allowed_p=1 '\001')
    at /home/sss/gcc/gcc/gcc/cp/parser.c:6928
#18 0x080e89aa in cp_parser_block_declaration (parser=0x400b6924,
    statement_p=0 '\0') at /home/sss/gcc/gcc/gcc/cp/parser.c:6837
#19 0x080f8c64 in cp_parser_declaration (parser=0x400b6924)
    at /home/sss/gcc/gcc/gcc/cp/parser.c:6754

Environment:
System: Linux karma 2.6.8.1 #20 Mon Sep 13 23:48:47 EDT 2004 i686 i686 i386 GNU/Linux
Architecture: i686

	<machine, os, target, libraries (multiple lines)>
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: /home/sss/gcc/gcc/configure --prefix=/usr/local/gcc --enable-threads=posix --enable-long-long --enable-languages=c,c++,f95

How-To-Repeat:

-----------------------------------
class C;

void foo(void *p) {
  delete [] ((C*)p);
}
-----------------------------------
------- Additional Comments From snyder at fnal dot gov  2005-02-07 20:13 -------
Fix:
	<how to correct or work around the problem, if known (multiple lines)>

-- 
           Summary: g++ 4.0: ICE on vector delete of undefined class
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: snyder at fnal dot gov
                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


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/19811] [4.0 Regression] g++ 4.0: ICE on vector delete of undefined class
  2005-02-08  5:02 [Bug c++/19811] New: g++ 4.0: ICE on vector delete of undefined class gcc-bugzilla at gcc dot gnu dot org
@ 2005-02-08  5:14 ` pinskia at gcc dot gnu dot org
  2005-02-10 10:55 ` mmitchel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-08  5:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-07 20:15 -------
: Search converges between 2004-07-12-trunk (#484) and 2004-07-13-trunk (#485).

Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |error-recovery, ice-on-
                   |                            |invalid-code
   Last reconfirmed|0000-00-00 00:00:00         |2005-02-07 20:15:37
               date|                            |
            Summary|g++ 4.0: ICE on vector      |[4.0 Regression] g++ 4.0:
                   |delete of undefined class   |ICE on vector delete of
                   |                            |undefined class
   Target Milestone|---                         |4.0.0


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/19811] [4.0 Regression] g++ 4.0: ICE on vector delete of undefined class
  2005-02-08  5:02 [Bug c++/19811] New: g++ 4.0: ICE on vector delete of undefined class gcc-bugzilla at gcc dot gnu dot org
  2005-02-08  5:14 ` [Bug c++/19811] [4.0 Regression] " pinskia at gcc dot gnu dot org
@ 2005-02-10 10:55 ` mmitchel at gcc dot gnu dot org
  2005-02-10 13:55 ` cvs-commit at gcc dot gnu dot org
  2005-02-10 14:01 ` mmitchel at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-02-10 10:55 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mark at codesourcery dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/19811] [4.0 Regression] g++ 4.0: ICE on vector delete of undefined class
  2005-02-08  5:02 [Bug c++/19811] New: g++ 4.0: ICE on vector delete of undefined class gcc-bugzilla at gcc dot gnu dot org
  2005-02-08  5:14 ` [Bug c++/19811] [4.0 Regression] " pinskia at gcc dot gnu dot org
  2005-02-10 10:55 ` mmitchel at gcc dot gnu dot org
@ 2005-02-10 13:55 ` cvs-commit at gcc dot gnu dot org
  2005-02-10 14:01 ` mmitchel at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-02-10 13:55 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-02-10 07:55 -------
Subject: Bug 19811

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2005-02-10 07:55:06

Modified files:
	gcc/testsuite  : ChangeLog 
	gcc/cp         : ChangeLog call.c 
Added files:
	gcc/testsuite/g++.dg/init: delete1.C 

Log message:
	PR c++/19811
	* call.c (build_op_delete_call): Check COMPLETE_TYPE_P before
	attempting name lookup.
	
	PR c++/19811
	* g++.dg/init/delete1.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5013&r2=1.5014
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/delete1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4620&r2=1.4621
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&r1=1.529&r2=1.530



-- 


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/19811] [4.0 Regression] g++ 4.0: ICE on vector delete of undefined class
  2005-02-08  5:02 [Bug c++/19811] New: g++ 4.0: ICE on vector delete of undefined class gcc-bugzilla at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2005-02-10 13:55 ` cvs-commit at gcc dot gnu dot org
@ 2005-02-10 14:01 ` mmitchel at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-02-10 14:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2005-02-10 07:57 -------
Fixed in 4.0.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-02-10  7:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-08  5:02 [Bug c++/19811] New: g++ 4.0: ICE on vector delete of undefined class gcc-bugzilla at gcc dot gnu dot org
2005-02-08  5:14 ` [Bug c++/19811] [4.0 Regression] " pinskia at gcc dot gnu dot org
2005-02-10 10:55 ` mmitchel at gcc dot gnu dot org
2005-02-10 13:55 ` cvs-commit at gcc dot gnu dot org
2005-02-10 14:01 ` mmitchel at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).