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

            Bug ID: 104156
           Summary: -fcompare-debug failure with -O3
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cnsun at uwaterloo dot ca
  Target Milestone: ---

$ gcc-trunk -fcompare-debug -O3 small.c
gcc-trunk: error: small.c: ‘-fcompare-debug’ failure (length)
$ 
$ cat small.c
short a, d;
int b, c;
static int e() {
  int f = -2L, g = 9, h = 0;
  for (; h < 2; h++)
    if (a <= 5) {
      g = 0;
      if (c && a)
        break;
      if (c - 1)
        goto i;
    }
  if (b) {
    int *j[] = {&f};
    if (d)
      for (; f < 9; f++)
        if (g)
          for (; f; f++)
            ;
  i:
    while (f) {
      a--;
      break;
    }
  }
}
int main() { e(); }
$ 
$ 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.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /tmp/tmp.ahmEMGgtK2-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.1 20220120 (experimental) [master -g30f2c22de] (GCC) 
$

Reply via email to