From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30199 invoked by alias); 15 Apr 2003 16:09:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 30172 invoked by uid 48); 15 Apr 2003 16:09:01 -0000 Date: Tue, 15 Apr 2003 16:09:00 -0000 Message-ID: <20030415160901.30171.qmail@sources.redhat.com> To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, jh@suse.cz, nathan@gcc.gnu.org, nobody@gcc.gnu.org, pthomas@suse.de From: bangerth@dealii.org Reply-To: bangerth@dealii.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, jh@suse.cz, nathan@gcc.gnu.org, nobody@gcc.gnu.org, pthomas@suse.de, gcc-gnats@gcc.gnu.org Subject: Re: c++/10405: [3.3/3.4 regression] Segfault in setup_class_bindings X-SW-Source: 2003-04/txt/msg00698.txt.bz2 List-Id: Old Synopsis: [3.3/3.4 regression] [x86-64] Recently introduced segfault in setup_class_bindings New Synopsis: [3.3/3.4 regression] Segfault in setup_class_bindings Responsible-Changed-From-To: unassigned->nathan Responsible-Changed-By: bangerth Responsible-Changed-When: Tue Apr 15 16:09:01 2003 Responsible-Changed-Why: Author of a patch that might have caused this. State-Changed-From-To: open->analyzed State-Changed-By: bangerth State-Changed-When: Tue Apr 15 16:09:01 2003 State-Changed-Why: Man, this was a tough one (looks like memory corruption, since changing names makes the ICE go away sometimes): ---------------------------- struct Empty {}; struct Y { Y(); }; struct S : Y, Empty { enum {}; bool b1, b2, b3, b4, b5, b6, SAMENAME, b7, b8, b9; enum {}; enum SAMENAME { n }; }; S s; -------------------------- This crashes 3.3 and mainline (3.4). It doesn't in 3.2.3. x/z> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc x.cc:12: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See for instructions. The ICE happens here: (gdb) bt #0 setup_class_bindings (name=0x401989c0, type_binding_p=1) at ../../gcc-3.4-CVS/gcc/cp/search.c:2052 #1 0x0812d060 in dfs_push_type_decls (binfo=0x40198740, data=0x0) at ../../gcc-3.4-CVS/gcc/cp/search.c:2104 #2 0x0812b2d8 in dfs_walk_real (binfo=0x40198740, prefn=0, postfn=0x812cfc0 , qfn=0x812c8a0 , data=0x0) at ../../gcc-3.4-CVS/gcc/cp/search.c:1615 #3 0x0812b41e in dfs_walk (binfo=0x0, fn=0, qfn=0, data=0x0) at ../../gcc-3.4-CVS/gcc/cp/search.c:1629 #4 0x0812d4b4 in push_class_decls (type=0x2) at ../../gcc-3.4-CVS/gcc/cp/search.c:2169 #5 0x080cc67b in pushclass (type=0x4019b000, modify=true) at ../../gcc-3.4-CVS/gcc/cp/class.c:5594 This is here: /* First, deal with the type binding. */ if (type_binding_p) { type_binding = lookup_member (current_class_type, name, /*protect=*/2, /*want_type=*/true); if (TREE_CODE (type_binding) == TREE_LIST && TREE_TYPE (type_binding) == error_mark_node) /* NAME is ambiguous. */ push_class_level_binding (name, type_binding); else pushdecl_class_level (type_binding); } It crashes in the inner if clause, since type_binding==0. Nathan, the assignment to type_binding was last changed by this patch: ---------------------------- revision 1.252 date: 2003/02/15 18:03:22; author: nathan; state: Exp; lines: +135 -273 * search.c: ANSIfy function declarations and definitions. * cp-tree.h (lookup_field, lookup_member): Last parameter is a bool. * call.c (build_method_call, resolve_scoped_fn_name, build_java_interface_fn_ref): Adjust lookup_field, lookup_member calls. * class.c (handle_using_decl): Likewise. * decl.c (make_typename_type, make_unmound_class_template, start_decl, compute_array_index_type): Likewise. * decl2.c (build_expr_from_tree, build_call_from_tree): Likewise. * init.c (expand_member_init, build_member_call): Likewise. * pt.c (tsubst_copy, tsubst_copy_and_build, do_decl_instantiation, resolve_typename_type): Likewise. * typeck.c (lookup_destructor, finish_class_member_access_exprm build_prememfunc_access_expr): Likewise. Would you mind taking a look? W. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10405