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

            Bug ID: 112889
           Summary: ICE with -fanalyzer seen on Linux kernel
                    drivers/infiniband/hw/cxgb4/cm.c
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: dmalcolm at gcc dot gnu.org
            Blocks: 106358
  Target Milestone: ---

Affects only trunk (for gcc 14): https://godbolt.org/z/Tshdnvshx

typedef unsigned char __u8;
struct sk_buff
{
  unsigned char *data;
};
struct cpl_pass_accept_req
{
  __u8 : 6;
  __u8 sack : 1;
};
void build_cpl_pass_accept_req(struct sk_buff* skb)
{
  struct cpl_pass_accept_req* req;
  skb->data -= sizeof(*req);
  req = (struct cpl_pass_accept_req *)skb->data;
  req->sack = 1;
}

gcc -fanalyzer 

t.c: In function ‘build_cpl_pass_accept_req’:
t.c:16:13: internal compiler error: in put, at hash-map.h:177
   16 |   req->sack = 1;
      |   ~~~~~~~~~~^~~
0x87eec0 hash_map<ana::binding_key const*, ana::svalue const*,
simple_hashmap_traits<default_hash_traits<ana::binding_key const*>, ana::svalue
const*> >::put(ana::binding_key const* const&, ana::svalue const* const&)
        ../../src/gcc/hash-map.h:177
0x87f842 hash_map<ana::concrete_binding, ana::concrete_binding*,
simple_hashmap_traits<default_hash_traits<ana::concrete_binding>,
ana::concrete_binding*> >::put(ana::concrete_binding const&,
ana::concrete_binding* const&)
        ../../src/gcc/analyzer/store.cc:2246
0x87f842 consolidation_map<ana::concrete_binding>::put(ana::concrete_binding
const&, ana::concrete_binding*)
        ../../src/gcc/analyzer/analyzer.h:525
0x87f842
ana::store_manager::get_concrete_binding(generic_wide_int<fixed_wide_int_storage<128>
>, generic_wide_int<fixed_wide_int_storage<128> >)
        ../../src/gcc/analyzer/store.cc:2232
0x14db141 ana::binding_key::make(ana::store_manager*, ana::region const*)
        ../../src/gcc/analyzer/store.cc:133
0x14ddcd6 ana::binding_cluster::bind(ana::store_manager*, ana::region const*,
ana::svalue const*)
        ../../src/gcc/analyzer/store.cc:1377
0x14ddcd6 ana::binding_cluster::bind(ana::store_manager*, ana::region const*,
ana::svalue const*)
        ../../src/gcc/analyzer/store.cc:1365
0x14de76a ana::store::set_value(ana::store_manager*, ana::region const*,
ana::svalue const*, ana::uncertainty_t*)
        ../../src/gcc/analyzer/store.cc:2617
0x144ceb5 ana::exploded_node::on_stmt(ana::exploded_graph&, ana::supernode
const*, gimple const*, ana::program_state*, ana::uncertainty_t*, bool*,
ana::path_context*)
        ../../src/gcc/analyzer/engine.cc:1507
0x144f680 ana::exploded_graph::process_node(ana::exploded_node*)
        ../../src/gcc/analyzer/engine.cc:4123
0x145035a ana::exploded_graph::process_worklist()
        ../../src/gcc/analyzer/engine.cc:3512
0x1452330 ana::impl_run_checkers(ana::logger*)
        ../../src/gcc/analyzer/engine.cc:6206
0x14532c6 ana::run_checkers()
        ../../src/gcc/analyzer/engine.cc:6297
0x14445ec execute
        ../../src/gcc/analyzer/analyzer-pass.cc:87


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106358
[Bug 106358] [meta-bug] tracker bug for building the Linux kernel with
-fanalyzer

Reply via email to