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

            Bug ID: 101394
           Summary: ICE on valid code with -O2: SSA corruption: Unable to
                    coalesce ssa_names 10 and 19 which are marked as MUST
                    COALESCE.
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cnsun at uwaterloo dot ca
  Target Milestone: ---

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/scratch/software/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /tmp/tmp.RJV1U21mAq-gcc-builder/gcc/configure
--enable-languages=c,c++,lto --enable-checking-yes --enable-multiarch
--prefix=/scratch/software/gcc-trunk --disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20210709 (experimental) [master revision
:aa0aefd8a:fdc4d2a516d042bc9a6936fad3f887aff353a296] (GCC)

$ cat mutant.c
a, b, c, d;
e() __attribute__((returns_twice));
f() {
  int *g = c;
  if (b) {
    h();
    g--;
    if (a)
      if (d)
        h();
  }
  if (g++)
    e();
  c = g;
}

$ gcc-trunk -w -O2 mutant.c
Unable to coalesce ssa_names 10 and 19 which are marked as MUST COALESCE.
g_10(ab) and  g_19(ab)
during RTL pass: expand
mutant.c: In function ‘f’:
mutant.c:3:1: internal compiler error: SSA corruption
    3 | f() {
      | ^
0x104b21c fail_abnormal_edge_coalesce
        /tmp/tmp.RJV1U21mAq-gcc-builder/gcc/gcc/tree-ssa-coalesce.c:1003
0x104b21c coalesce_partitions
        /tmp/tmp.RJV1U21mAq-gcc-builder/gcc/gcc/tree-ssa-coalesce.c:1425
0x104b21c coalesce_ssa_name(_var_map*)
        /tmp/tmp.RJV1U21mAq-gcc-builder/gcc/gcc/tree-ssa-coalesce.c:1755
0xfe32a9 remove_ssa_form
        /tmp/tmp.RJV1U21mAq-gcc-builder/gcc/gcc/tree-outof-ssa.c:1065
0xfe32a9 rewrite_out_of_ssa(ssaexpand*)
        /tmp/tmp.RJV1U21mAq-gcc-builder/gcc/gcc/tree-outof-ssa.c:1323
0xa6299a execute
        /tmp/tmp.RJV1U21mAq-gcc-builder/gcc/gcc/cfgexpand.c:6588
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Reply via email to