Skip to contentSkip to conversation

c++/10438: [3.3 regression] [hppa] Segfault when building jade

parisc-linux Giovanni Bajo 2 participants 3 messages Apr 19, 2003

lore
Share & tools
lore
#0 lore raw

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
r=10438

Confirmed. Slightly reduced testcase:

--------------------------------
struct Foo

{
    struct Nested1
    {
        enum E
        {
            v1,v2,v3,v4,v5,v6
        } E;
    };

    struct Nested2 : public Nested1
    {};
};

--------------------------------
pr10438.cpp:12: internal compiler error: Segmentation fault Please submit a full bug report,

It looks like a memory corruption bug, while playing with it I had the ICE on and off simply by changing variable names. You can also see that the ICE disappears if you remove some elements from within the enum. It seems that the culript is the variable defined with the same name of the enum type.

It's a regression on 3.3 and 3.4 with respect to 3.2, where it compiles fine.

Giovanni Bajo

#1 lore raw
Quoted 1 line

Confirmed. Slightly reduced testcase:

Thanks.

Running under gdb, I see:

(gdb) run bug.cxx
Starting program: /home/tausq/gcc/build-3.3/gcc/cc1plus bug.cxx

Program received signal SIGSEGV, Segmentation fault. setup_class_bindings (name=0x401c9780, type_binding_p=1)

    at ../../gcc-3.3/gcc/cp/search.c:2560
2560          if (TREE_CODE (type_binding) == TREE_LIST
(gdb) bt
#0  setup_class_bindings (name=0x401c9780, type_binding_p=1)
    at ../../gcc-3.3/gcc/cp/search.c:2560
#1  0x00094410 in dfs_push_type_decls (binfo=0x401c9b40, data=0x401cf010)
    at ../../gcc-3.3/gcc/cp/search.c:2615
#2  0x00092f50 in dfs_walk_real (binfo=0x401c9b40, prefn=0,
    postfn=0x362c0e <__JCR_LIST__+486>, qfn=0x362bde <__JCR_LIST__+438>,
    data=0x0) at ../../gcc-3.3/gcc/cp/search.c:1911

[...]

type_binding is NULL after lookup_member()...

randolph

Signature · 3 lines
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/
#2 lore raw
In reply to Giovanni Bajo
Quoted 1 line

Confirmed. Slightly reduced testcase:

Thanks.

Running under gdb, I see:

(gdb) run bug.cxx
Starting program: /home/tausq/gcc/build-3.3/gcc/cc1plus bug.cxx

Program received signal SIGSEGV, Segmentation fault. setup_class_bindings (name=0x401c9780, type_binding_p=1)

    at ../../gcc-3.3/gcc/cp/search.c:2560
2560          if (TREE_CODE (type_binding) == TREE_LIST
(gdb) bt
#0  setup_class_bindings (name=0x401c9780, type_binding_p=1)
    at ../../gcc-3.3/gcc/cp/search.c:2560
#1  0x00094410 in dfs_push_type_decls (binfo=0x401c9b40, data=0x401cf010)
    at ../../gcc-3.3/gcc/cp/search.c:2615
#2  0x00092f50 in dfs_walk_real (binfo=0x401c9b40, prefn=0,
    postfn=0x362c0e <__JCR_LIST__+486>, qfn=0x362bde <__JCR_LIST__+438>,
    data=0x0) at ../../gcc-3.3/gcc/cp/search.c:1911

[...]

type_binding is NULL after lookup_member()...

randolph

Signature · 3 lines
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/