https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101219
--- Comment #4 from Sergei Trofimovich <slyfox at gcc dot gnu.org> ---
Got the same mednafen crash today. Poked slightly at the context in gdb.
>From what I understand the crash happens when analysing statement `void
(PCEFast_PSG::*ch_0)(int, int *);`. There is no access to the any object field
implied by `TYPE_BINFO (access_type)`. Or is there? Should it refer to `class
PCEFast_PSG`?
(gdb) fr 1
#1 0x000000000079ff83 in finish_non_static_data_member (decl=0x7ffff7652a18,
object=0x7ffff7796860, qualifying_scope=0x0) at
/home/slyfox/dev/git/gcc/gcc/cp/semantics.c:2208
2208 perform_or_defer_access_check (TYPE_BINFO (access_type), decl,
(gdb) list
2203 QUALIFYING_SCOPE is also non-null. */
2204 else
2205 {
2206 volatile tree access_type = TREE_TYPE (object);
2207
2208 perform_or_defer_access_check (TYPE_BINFO (access_type), decl,
2209 decl, tf_warning_or_error);
2210
2211 /* If the data member was named `C::M', convert `*this' to `C'
2212 first. */
(gdb) call print_tree(object)
No symbol "print_tree" in current context.
(gdb) call debug_tree(object)
<ptrmem_cst 0x7ffff7796860
type <record_type 0x7ffff77a1bd0 type_2 type_6 TI
size <integer_cst 0x7ffff7625f18 constant 128>
unit-size <integer_cst 0x7ffff7625f30 constant 16>
align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff77a1bd0
fields <field_decl 0x7ffff7652a18 __pfn type <pointer_type
0x7ffff77a1b28>
unsigned nonaddressable DI psg.cpp.cpp:5:39
size <integer_cst 0x7ffff7625ed0 constant 64>
unit-size <integer_cst 0x7ffff7625ee8 constant 8>
align:64 warn_if_not_align:0 offset_align 128
offset <integer_cst 0x7ffff7625f00 constant 0>
bit-offset <integer_cst 0x7ffff7625f48 constant 0> context
<record_type 0x7ffff77a1bd0> chain <field_decl 0x7ffff7652ab0 __delta>>
ptrmemfunc fn type <pointer_type 0x7ffff77a1b28 type <method_type
0x7ffff77a17e0>
public unsigned type_6 DI size <integer_cst 0x7ffff7625ed0 64>
unit-size <integer_cst 0x7ffff7625ee8 8>
align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff77a1b28>
chain <type_decl 0x7ffff7652b48 __ptrmemfunc_type>>
constant>
(gdb) call debug_tree(access_type)
<record_type 0x7ffff77a1bd0 type_2 type_6 TI
size <integer_cst 0x7ffff7625f18 type <integer_type 0x7ffff76430a8
bitsizetype> constant 128>
unit-size <integer_cst 0x7ffff7625f30 type <integer_type 0x7ffff7643000
sizetype> constant 16>
align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff77a1bd0
fields <field_decl 0x7ffff7652a18 __pfn
type <pointer_type 0x7ffff77a1b28 type <method_type 0x7ffff77a17e0>
public unsigned type_6 DI
size <integer_cst 0x7ffff7625ed0 constant 64>
unit-size <integer_cst 0x7ffff7625ee8 constant 8>
align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff77a1b28>
unsigned nonaddressable DI psg.cpp.cpp:5:39 size <integer_cst
0x7ffff7625ed0 64> unit-size <integer_cst 0x7ffff7625ee8 8>
align:64 warn_if_not_align:0 offset_align 128
offset <integer_cst 0x7ffff7625f00 constant 0>
bit-offset <integer_cst 0x7ffff7625f48 constant 0> context <record_type
0x7ffff77a1bd0>
chain <field_decl 0x7ffff7652ab0 __delta type <integer_type
0x7ffff7643738 long int>
nonaddressable DI psg.cpp.cpp:5:39 size <integer_cst 0x7ffff7625ed0
64> unit-size <integer_cst 0x7ffff7625ee8 8>
align:64 warn_if_not_align:0 offset_align 128 offset <integer_cst
0x7ffff7625f00 0> bit-offset <integer_cst 0x7ffff7625ed0 64> context
<record_type 0x7ffff77a1bd0>>> ptrmemfunc fn type <pointer_type 0x7ffff77a1b28>
chain <type_decl 0x7ffff7652b48 __ptrmemfunc_type>>