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

            Bug ID: 110766
           Summary: ICE on valid code at -O3 on x86_64-linux-gnu: in
                    gimple_phi_arg_def_from_edge, at gimple.h:4699
           Product: gcc
           Version: unknown
            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: ---

It seems to be related to the recently fixed PR 110669. 

Compiler Explorer: https://godbolt.org/z/85drx858c

[524] % 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/14.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 14.0.0 20230721 (experimental) [master r14-924-gd709841ae0f] (GCC) 
[525] % 
[525] % gcctk -O3 small.c
during GIMPLE pass: sccp
small.c: In function ‘main’:
small.c:4:5: internal compiler error: in gimple_phi_arg_def_from_edge, at
gimple.h:4699
    4 | int main() {
      |     ^~~~
0x80fe21 gimple_phi_arg_def_from_edge(gphi const*, edge_def const*)
        ../../gcc-trunk/gcc/gimple.h:4699
0x811332 gimple_phi_arg_def_from_edge(gphi const*, edge_def const*)
        ../../gcc-trunk/gcc/tree.h:3700
0x811332 final_value_replacement_loop(loop*)
        ../../gcc-trunk/gcc/tree-scalar-evolution.cc:3733
0x118f795 execute
        ../../gcc-trunk/gcc/tree-ssa-loop.cc:411
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.
[526] % 
[526] % cat small.c
int a, b, c, e;
short d, f;
int g(int h) { return h > a ? h : h << a; }
int main() {
  while (e) {
    b = 0;
    for (; b < 3; b++)
      if (c) {
        e = g(1);
        f = e | d;
      }
    d = 0;
  }
  return 0;
}

Reply via email to