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

            Bug ID: 110940
           Summary: ICE at -O3 on x86_64-linux-gnu: in apply_scale, at
                    profile-count.h:1180
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

This appears to be a recent regression.

Compiler Explorer: https://godbolt.org/z/evGMc8xEW

[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/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 20230808 (experimental) (GCC) 
[596] % 
[596] % gcctk -O3 -c small.c
during GIMPLE pass: vect
small.c: In function ‘main’:
small.c:3:5: internal compiler error: in apply_scale, at profile-count.h:1180
    3 | int main() {
      |     ^~~~
0xab66c3 profile_count::apply_scale(profile_count, profile_count) const
        ../../gcc-trunk/gcc/profile-count.h:1180
0x10311cf fold_loop_internal_call(gimple*, tree_node*)
        ../../gcc-trunk/gcc/tree-cfg.cc:7738
0x12d2ef5 execute
        ../../gcc-trunk/gcc/tree-vectorizer.cc:1328
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.
[597] % 
[597] % cat small.c
int a, b[1], c, *d = &a, e, f, g, h, i, j;
extern int l();
int main() {
  if (l())
    for (;;)
      for (; g;)
        for (; e;)
          for (; a;)
            for (; f;)
              for (; h;)
                for (; i;)
                  for (; c;)
                    for (; j;)
                      ;
  l();
  for (; c; c++)
    b[*d] = 0;
  return 0;
}

Reply via email to