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

            Bug ID: 127163
           Summary: [17 Regression] ICE: tree check: expected integer_cst,
                    have complex_cst in to_wide, at tree.h:6744 with
                    division
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          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 65462
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65462&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c 
during GIMPLE pass: forwprop
testcase.c: In function 'foo':
testcase.c:3:1: internal compiler error: tree check: expected integer_cst, have
complex_cst in to_wide, at tree.h:6744
    3 | void foo() { c /= (_Bool) + b; }
      | ^~~~
0x2f0039d internal_error(char const*, ...)
        /repo/gcc-trunk/gcc/diagnostic-global-context.cc:787
0x9419a5 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        /repo/gcc-trunk/gcc/tree.cc:9241
0x941c06 tree_check(tree_node const*, char const*, int, char const*, tree_code)
        /repo/gcc-trunk/gcc/tree.h:4119
0x941c06 wi::to_wide(tree_node const*)
        /repo/gcc-trunk/gcc/tree.h:6744
0x94446b wi::to_wide(tree_node const*)
        /repo/gcc-trunk/gcc/tree.h:4053
0x94446b tree_int_cst_sgn(tree_node const*)
        /repo/gcc-trunk/gcc/tree.cc:6747
0x17fbdd9 simplify_phi_result_movdiv
        /repo/gcc-trunk/gcc/tree-ssa-forwprop.cc:4851
0x180dc59 execute
        /repo/gcc-trunk/gcc/tree-ssa-forwprop.cc:7180
/repo/gcc-trunk/binary-trunk-20260831154048-r17-3795-gb74e013cc139c0-checking-yes-rtl-df-extra-nobootstrap-pr127154-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/17.0.0/cc1
-quiet -iprefix
/repo/gcc-trunk/binary-trunk-20260831154048-r17-3795-gb74e013cc139c0-checking-yes-rtl-df-extra-nobootstrap-pr127154-amd64/bin/../lib/gcc/x86_64-pc-linux-gnu/17.0.0/
testcase.c -quiet -dumpdir a- -dumpbase testcase.c -dumpbase-ext .c
-mtune=generic -march=x86-64 -O -o /tmp/ccjO0zOQ.s
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-20260831154048-r17-3795-gb74e013cc139c0-checking-yes-rtl-df-extra-nobootstrap-pr127154-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/17.0.0/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 --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-20260831154048-r17-3795-gb74e013cc139c0-checking-yes-rtl-df-extra-nobootstrap-pr127154-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 17.0.0 20260831 (experimental) (GCC)

Reply via email to