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

            Bug ID: 122376
           Summary: [16 Regression] ICE in graphviz-12.2.1: Segmentation
                    fault (during GIMPLE pass: vect)
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: slyfox at gcc dot gnu.org
  Target Milestone: ---

Noticed gcc SIGSEGV on today's gcc-master r16-4549-gbb16ab062333ef (did not
bisect) when building graphviz-12.1.1.

Extracted example:

// $ cat route.c.c
struct Pxy_t {
  double x, y;
};
typedef struct {
  struct Pxy_t a[2];
} tna_t;
int mkspline_inpn, mkspline_i;
tna_t *mkspline_tnas;
double mkspline_x_1, dot_p2_1, dot_p2_0;
static double dot(struct Pxy_t);
void mkspline() {
  for (; mkspline_i < mkspline_inpn; mkspline_i++)
    mkspline_x_1 += dot(mkspline_tnas[mkspline_i].a[1]);
}
double dot(struct Pxy_t p1) { return p1.x * dot_p2_0 + p1.y * dot_p2_1; }

$ gcc/xgcc -Bgcc -c route.c.c -O2 -o bug.o
during GIMPLE pass: vect
route.c.c: In function ‘mkspline’:
route.c.c:11:6: internal compiler error: Segmentation fault
   11 | void mkspline() {
      |      ^~~~~~~~
0x2631b04 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x2623de0 internal_error(char const*, ...)
        ???:0
0x1085775 crash_signal(int)
        ???:0
0x13df8de vect_transform_reduction(_loop_vec_info*, _stmt_vec_info*,
gimple_stmt_iterator*, _slp_tree*)
        ???:0
0x13d4e34 vect_transform_stmt(vec_info*, _stmt_vec_info*,
gimple_stmt_iterator*, _slp_tree*, _slp_instance*)
        ???:0
0x14280d9 vect_schedule_slp_node(vec_info*, _slp_tree*, _slp_instance*)
        ???:0
0x1440a97 vect_schedule_scc(vec_info*, _slp_tree*, _slp_instance*,
hash_map<_slp_tree*, slp_scc_info,
simple_hashmap_traits<default_hash_traits<_slp_tree*>, slp_scc_info> >&, int&,
vec<_slp_tree*, va_heap, vl_ptr>&)
        ???:0
0x1441b73 vect_schedule_slp(vec_info*, vec<_slp_instance*, va_heap, vl_ptr>
const&)
        ???:0
0x1400ed7 vect_transform_loop(_loop_vec_info*, gimple*)
        ???:0
0x145616a vect_transform_loops(hash_table<simduid_to_vf, false, xcallocator>*&,
loop*, gimple*, function*)
        ???:0
0x14567cf try_vectorize_loop(hash_table<simduid_to_vf, false, xcallocator>*&,
unsigned int*, loop*, function*)
        ???:0
0x1456ab9 (anonymous namespace)::pass_vectorize::execute(function*)
        ???:0
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.

$ gcc/xgcc -Bgcc -v
Reading specs from gcc/specs
COLLECT_GCC=gcc/xgcc
COLLECT_LTO_WRAPPER=gcc/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/slyfox/dev/git/gcc/configure --disable-multilib
--disable-bootstrap --disable-lto --disable-libsanitizer
--disable-libstdcxx-pch --enable-languages=c,c++ --disable-libgomp
--disable-libquadmath --disable-libvtv CFLAGS='-O1 -g0' CXXFLAGS='-O1 -g0'
LDFLAGS='-O1 -g0'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 16.0.0 20251022 (experimental) (GCC)

Reply via email to