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

            Bug ID: 106551
           Summary: [13 Regression] dup2 causes -fanalyser ICE in
                    valid_to_unchecked_state, at analyzer/sm-fd.cc:751
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: slyfox at gcc dot gnu.org
  Target Milestone: ---

This week's gcc started ICEing on libpipeline-1.5.4 upstream package.

Minimal reproducer turned up by cvise:

    $ cat a.c.c
    extern int m;
    int dup2(int, int);
    void error(void);
    void max_active_pipelines_pdes(void) {
      if (dup2(m, 1))
        error();
    }

$ gcc -g -O2 -Wall  -c a.c.c -fanalyzer
during IPA pass: analyzer
a.c.c: In function 'max_active_pipelines_pdes':
a.c.c:5:7: internal compiler error: in valid_to_unchecked_state, at
analyzer/sm-fd.cc:751
    5 |   if (dup2(m, 1))
      |       ^~~~~~~~~~
0x1ef7d74 diagnostic_impl(rich_location*, diagnostic_metadata const*, int, char
const*, __va_list_tag (*) [1], diagnostic_t)
        ???:0
0x1ef89c6 internal_error(char const*, ...)
        ???:0
0x9023d4 fancy_abort(char const*, int, char const*)
        ???:0
0x85baa7 ana::(anonymous
namespace)::fd_state_machine::check_for_dup(ana::sm_context*, ana::supernode
const*, gimple const*, gcall const*, tree_node*, ana::(anonymous
namespace)::dup) const [clone .cold]
        ???:0
0x135181c ana::(anonymous
namespace)::fd_state_machine::on_stmt(ana::sm_context*, ana::supernode const*,
gimple const*) const
        ???:0
0x12fcd74 ana::exploded_node::on_stmt(ana::exploded_graph&, ana::supernode
const*, gimple const*, ana::program_state*, ana::uncertainty_t*,
ana::path_context*)
        ???:0
0x12ff7ab ana::exploded_graph::process_node(ana::exploded_node*)
        ???:0
0x130064a ana::exploded_graph::process_worklist()
        ???:0
0x1302999 ana::impl_run_checkers(ana::logger*)
        ???:0
0x130394e ana::run_checkers()
        ???:0
0x12f37e8 (anonymous namespace)::pass_analyzer::execute(function*)
        ???:0

$ gcc -v |& unnix
Using built-in specs.
COLLECT_GCC=/<<NIX>>/gcc-13.0.0/bin/gcc
COLLECT_LTO_WRAPPER=/<<NIX>>/gcc-13.0.0/libexec/gcc/x86_64-unknown-linux-gnu/13.0.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with:
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 13.0.0 20220807 (experimental) (GCC)

Reply via email to