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

            Bug ID: 125923
           Summary: ICE on valid code at -O3 with "-fno-tree-dce" on
                    x86_64-linux-gnu: in factor_out_conditional_load, at
                    tree-ssa-phiopt.cc:3716
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/5KW9vjfa3

Note:
- fails: trunk
- works: 16.1 and earlier

[595] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/home/suz/suz-local/software/local/gcc-trunk/bin/../libexec/gcc/x86_64-pc-linux-gnu/17.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--enable-checking=yes --prefix=/local/suz-local/software/local/gcc-trunk
--enable-sanitizers --enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 17.0.0 20260621 (experimental) (GCC)
[596] %
[596] % gcctk -O3 -c small.c
[597] %
[597] % gcctk -O3 -c -fno-tree-dce small.c
during GIMPLE pass: phiopt
small.c: In function ā€˜e’:
small.c:2:6: internal compiler error: in factor_out_conditional_load, at
tree-ssa-phiopt.cc:3716
    2 | void e() {
      |      ^
0x266a9ab internal_error(char const*, ...)
        ../../gcc-trunk/gcc/diagnostic-global-context.cc:787
0xa2ff10 fancy_abort(char const*, int, char const*)
        ../../gcc-trunk/gcc/diagnostics/context.cc:1813
0x905ef1 factor_out_conditional_load
        ../../gcc-trunk/gcc/tree-ssa-phiopt.cc:3716
0x905ef1 factor_out_all
        ../../gcc-trunk/gcc/tree-ssa-phiopt.cc:3922
0x905ef1 operator()
        ../../gcc-trunk/gcc/tree-ssa-phiopt.cc:4447
0x905ef1 execute_over_cond_phis<(anonymous
namespace)::pass_phiopt::execute(function*)::<lambda(basic_block, basic_block,
basic_block, edge, edge, bool, gcond*)> >
        ../../gcc-trunk/gcc/tree-ssa-phiopt.cc:4205
0x905ef1 execute
        ../../gcc-trunk/gcc/tree-ssa-phiopt.cc:4498
/local/home/suz/suz-local/software/local/gcc-trunk/bin/../libexec/gcc/x86_64-pc-linux-gnu/17.0.0/cc1
-quiet -I /usr/local/include -I /local/suz-local/software/local/include
-imultiarch x86_64-linux-gnu -iprefix
/local/home/suz/suz-local/software/local/gcc-trunk/bin/../lib/gcc/x86_64-pc-linux-gnu/17.0.0/
small.c -quiet -dumpbase small.c -dumpbase-ext .c -mtune=generic -march=x86-64
-O3 -fno-tree-dce -o /tmp/ccqqp6Jk.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.
[598] %
[598] % cat small.c
int a, b, c, d;
void e() {
  d = a && d;
  if (b)
    b = 0;
  while (!a || b)
    c ^= 1;
}

Reply via email to