https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124418

            Bug ID: 124418
           Summary: implementation of interface with null procedure by
                    protected type causes segfault if procedure is not
                    overridden
           Product: gcc
           Version: 15.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: liam at liampwll dot com
                CC: dkm at gcc dot gnu.org
  Target Milestone: ---

See summary above and reproducer below. This is a regression on 15 and 16, I
have not bisected it yet since it's 1AM and I need some sleep after finally
tracking this down. I'll bisect tomorrow if no one else has by then:


pragma Ada_2022;

procedure Example is
   package Pack is
      type I is synchronized interface;

      procedure P (This : in out I) is null;

      type T is synchronized new I with private;
   private
      protected type T is new I with
      end T;
   end Pack;

   package body Pack is
      protected body T is
      end T;
   end Pack;
begin
   null;
end Example;


#0  fixup_vla_decls (block=0x0) at ../../gcc/gcc/tree-nested.cc:3366
        var = <optimized out>
        __FUNCTION__ = "fixup_vla_decls"
#1  0x0000000001b55321 in finalize_nesting_tree_1 (root=root@entry=0x4962090)
at ../../gcc/gcc/tree.h:3839
        cleanup_list = 0x0
        stmt_list = 0x0
        stmt = <optimized out>
        context = 0x7ffff5f92300
        sf = 0x7ffff5fd38f0
        __FUNCTION__ = "finalize_nesting_tree_1"
#2  0x0000000001b57908 in finalize_nesting_tree (root=0x4962120) at
../../gcc/gcc/tree-nested.cc:3765
        n = 0x4962090
#3  lower_nested_functions (fndecl=fndecl@entry=0x7ffff5ed6e00) at
../../gcc/gcc/tree-nested.cc:3860
        cgn = <optimized out>
        root = 0x4962120
#4  0x0000000001513263 in cgraph_node::analyze (this=this@entry=0x7ffff7618880)
at ../../gcc/gcc/cgraphunit.cc:695
        decl = 0x7ffff5ed6e00
        saved_loc = 0
        __FUNCTION__ = "analyze"
#5  0x00000000015160a8 in analyze_functions (first_time=first_time@entry=true)
at ../../gcc/gcc/cgraphunit.cc:1265
        edge = <optimized out>
        decl = 0x7ffff5ed6e00
        cnode = 0x7ffff7618880
        first_handled = <optimized out>
        first_handled_var = <optimized out>
        reachable_call_targets = {m_table = {m_inserting_slot = 0x0, m_entries
= 0x4a03b00, m_size = 13, m_n_elements = 0, m_n_deleted = 0, 
            m_searches = 0, m_collisions = 0, m_size_prime_index = 1, m_ggc =
false, m_sanitize_eq_and_hash = true, static m_gather_mem_stats = false}}
        node = 0x7ffff7618880
        next = <optimized out>
        i = <optimized out>
        ref = <optimized out>
        changed = true
        saved_loc = <optimized out>
        __FUNCTION__ = "analyze_functions"
#6  0x000000000151700e in symbol_table::finalize_compilation_unit
(this=0x7ffff7606000) at ../../gcc/gcc/cgraphunit.cc:2574
No locals.
#7  0x0000000001a914d2 in compile_file () at ../../gcc/gcc/toplev.cc:479
No locals.
#8  0x0000000001029b60 in do_compile () at ../../gcc/gcc/toplev.cc:2208
        i = 1
        mode = <optimized out>
        min_exp = <optimized out>
        max_exp = <optimized out>
        __FUNCTION__ = <optimized out>
#9  toplev::main (this=this@entry=0x7fffffffccbe, argc=<optimized out>,
argc@entry=12, argv=<optimized out>, argv@entry=0x7fffffffcde8)
    at ../../gcc/gcc/toplev.cc:2371
        original_argv = {m_argv = 0x0}
#10 0x000000000102b4db in main (argc=12, argv=0x7fffffffcde8) at
../../gcc/gcc/main.cc:39
        toplev = {m_use_TV_TOTAL = true, m_init_signals = true}
        r = <optimized out>

Reply via email to