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

            Bug ID: 104863
           Summary: [12 regression] ICE in operator[], at vec.h:889
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: dimhen at gmail dot com
  Target Milestone: ---

r12-6649 PASS
r12-6793 FAIL
r12-7557 FAIL

$ $ cat y.i
extern void g();
struct a {
} b(int c, int d) {
  struct a *e = 0;
  int f;
  if (c & 1 || !(c & 2))
    return *e;
  f = 0;
  for (; f < d - 1; f++)
    g(e[1]);
}

$ gcc -fpreprocessed -O1 -fanalyzer -fanalyzer-transitivity y.i

during IPA pass: analyzer
y.i: In function ‘b’:
y.i:9:12: internal compiler error: in operator[], at vec.h:889
    9 |   for (; f < d - 1; f++)
      |          ~~^~~~~~~
0xd3c09c vec<ana::svalue const*, va_heap, vl_embed>::operator[](unsigned int)
        /home/dimhen/src/gcc_current/gcc/vec.h:889
0xd3c54d vec<ana::equiv_class*, va_heap, vl_embed>::operator[](unsigned int)
        /home/dimhen/src/gcc_current/gcc/analyzer/constraint-manager.cc:2031
0xd3c54d vec<ana::equiv_class*, va_heap, vl_ptr>::operator[](unsigned int)
        /home/dimhen/src/gcc_current/gcc/vec.h:1495
0xd3c54d ana::constraint_manager::get_equiv_class_by_index(unsigned int)
        /home/dimhen/src/gcc_current/gcc/analyzer/constraint-manager.h:428
0xd3c54d ana::equiv_class_id::get_obj(ana::constraint_manager&) const
        /home/dimhen/src/gcc_current/gcc/analyzer/constraint-manager.cc:1462
0xd3c54d ana::constraint_manager::add_constraint_internal(ana::equiv_class_id,
ana::constraint_op, ana::equiv_class_id)
        /home/dimhen/src/gcc_current/gcc/analyzer/constraint-manager.cc:1982
0x24e1671 ana::constraint_manager::add_unknown_constraint(ana::equiv_class_id,
tree_code, ana::equiv_class_id)
        /home/dimhen/src/gcc_current/gcc/analyzer/constraint-manager.cc:1931
0x24e5ab0 ana::constraint_manager::add_constraint(ana::svalue const*,
tree_code, ana::svalue const*)
        /home/dimhen/src/gcc_current/gcc/analyzer/constraint-manager.cc:1823
0x1783a70 ana::region_model::add_constraint(ana::svalue const*, tree_code,
ana::svalue const*, ana::region_model_context*)
        /home/dimhen/src/gcc_current/gcc/analyzer/region-model.cc:3049
0x1784221 ana::region_model::add_constraint(tree_node*, tree_code, tree_node*,
ana::region_model_context*, ana::rejected_constraint**)
        /home/dimhen/src/gcc_current/gcc/analyzer/region-model.cc:3077
0x177011f ana::program_state::on_edge(ana::exploded_graph&,
ana::exploded_node*, ana::superedge const*, ana::uncertainty_t*)
        /home/dimhen/src/gcc_current/gcc/analyzer/program-state.cc:1035
0x175deba ana::exploded_graph::process_node(ana::exploded_node*)
        /home/dimhen/src/gcc_current/gcc/analyzer/engine.cc:3976
0x175f252 ana::exploded_graph::process_worklist()
        /home/dimhen/src/gcc_current/gcc/analyzer/engine.cc:3186
0x17615bd ana::impl_run_checkers(ana::logger*)
        /home/dimhen/src/gcc_current/gcc/analyzer/engine.cc:5765
0x176241e ana::run_checkers()
        /home/dimhen/src/gcc_current/gcc/analyzer/engine.cc:5836
0x17520a8 execute
        /home/dimhen/src/gcc_current/gcc/analyzer/analyzer-pass.cc:87
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Command exited with non-zero status 1

$ gcc -v
Using built-in specs.
COLLECT_GCC=/home/dimhen/arch-gcc/gcc_current/bin/gcc
COLLECT_LTO_WRAPPER=/home/dimhen/arch-gcc/gcc_current/libexec/gcc/x86_64-pc-linux-gnu/12.0.1/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-pc-linux-gnu
Configured with: /home/dimhen/src/gcc_current/configure
--prefix=/home/dimhen/arch-gcc/gcc_current
--enable-checking=yes,df,fold,rtl,extra --enable-languages=c,c++,lto
--disable-multilib --enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-gnu-indirect-function --enable-cet --with-tune=native
--enable-libstdcxx-debug
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.1 20220309 (experimental) [master r12-7557-gd76511138dc] (GCC)

Reply via email to