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

            Bug ID: 118692
           Summary: [15 Regression] ICE: in tree_to_poly_uint64, at
                    tree.cc:3350 with out-of-bounds string ops
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: ice-checking, ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

Created attachment 60313
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60313&action=edit
reduced testcase

Similar to the fixed PR118651

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -march=graniterapids-d testcase.c
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:6:6: internal compiler error: in tree_to_poly_uint64, at
tree.cc:3350
    6 |   cf += *(_Complex *)__builtin_memcpy(8143523003042804629 + &c, 0, 0);
      |      ^~
0x2de3c21 internal_error(char const*, ...)
        /repo/gcc-trunk/gcc/diagnostic-global-context.cc:517
0xef8557 fancy_abort(char const*, int, char const*)
        /repo/gcc-trunk/gcc/diagnostic.cc:1722
0x90282a tree_to_poly_uint64(tree_node const*)
        /repo/gcc-trunk/gcc/tree.cc:3350
0x90282a tree_to_poly_uint64(tree_node const*)
        /repo/gcc-trunk/gcc/tree.cc:3348
0x16f66e1 bit_field_offset(tree_node const*)
        /repo/gcc-trunk/gcc/tree.h:5719
0x16f66e1 bit_field_ref_in_bounds_p
        /repo/gcc-trunk/gcc/tree-eh.cc:2662
0x16f66e1 tree_could_trap_p(tree_node*)
        /repo/gcc-trunk/gcc/tree-eh.cc:2715
0x11cbe87 set_mem_attributes_minus_bitpos(rtx_def*, tree_node*, int,
poly_int<1u, long>)
        /repo/gcc-trunk/gcc/emit-rtl.cc:2047
0x1205fd1 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /repo/gcc-trunk/gcc/expr.cc:12386
0x1206c2b expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier,
rtx_def**, bool)
        /repo/gcc-trunk/gcc/expr.cc:9521
0x1206c2b expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier)
        /repo/gcc-trunk/gcc/expr.h:323
0x1206c2b expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /repo/gcc-trunk/gcc/expr.cc:11812
0x1209465 expand_expr_real_gassign(gassign*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /repo/gcc-trunk/gcc/expr.cc:11190
0x120869d expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /repo/gcc-trunk/gcc/expr.cc:11368
0x121290c expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier)
        /repo/gcc-trunk/gcc/expr.h:323
0x121290c expand_operands(tree_node*, tree_node*, rtx_def*, rtx_def**,
rtx_def**, expand_modifier)
        /repo/gcc-trunk/gcc/expr.cc:9100
0x11ffdb0 expand_expr_real_2(separate_ops const*, rtx_def*, machine_mode,
expand_modifier)
        /repo/gcc-trunk/gcc/expr.cc:10069
0x1209413 expand_expr_real_gassign(gassign*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /repo/gcc-trunk/gcc/expr.cc:11186
0x120869d expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /repo/gcc-trunk/gcc/expr.cc:11368
0x121397d store_expr(tree_node*, rtx_def*, int, bool, bool)
        /repo/gcc-trunk/gcc/expr.cc:6771
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.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-20250128165007-r15-7257-g54bdeca3c62144-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/15.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-20250128165007-r15-7257-g54bdeca3c62144-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.1 20250128 (experimental) (GCC)

Reply via email to