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

            Bug ID: 103837
           Summary: [12 Regression] '-fcompare-debug' failure (length) w/
                    -Og -fmove-loop-invariants -fnon-call-exceptions
                    -fno-tree-dce
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---
            Target: x86_64-unknown-linux-gnu

gcc 12.0.0 20211219 snapshot (g:fcbf94a5be9e0c1ecad92da773a6632b86b7f70a) fails
-fcompare-debug check when compiling the following testcase w/ -Og
-fmove-loop-invariants -fnon-call-exceptions -fno-tree-dce:

unsigned long int
foo (int x)
{
  double a;
  int b;
  unsigned long int ret = a;

  for (;;)
    {
      b = !!((int) a);
      a = x;
    }

  return ret;
}

% x86_64-unknown-linux-gnu-gcc-12.0.0 -Og -fcompare-debug
-fmove-loop-invariants -fnon-call-exceptions -fno-tree-dce -c dbvufwcn.c
x86_64-unknown-linux-gnu-gcc-12.0.0: error: dbvufwcn.c: '-fcompare-debug'
failure (length)

--- dbvufwcn.c.gkd      2021-12-26 23:40:50.743359823 +0700
+++ dbvufwcn.gk.c.gkd   2021-12-26 23:40:50.794356341 +0700
@@ -17,16 +17,6 @@
      (expr_list:REG_DEAD (reg/v:DF 20 xmm0 [orig:84 a ] [84])
         (expr_list:REG_UNUSED (reg:CCFP 17 flags)
             (nil))))
-(insn # 0 0 2 (set (reg:V2DF 20 xmm0 [orig:84 a ] [84])
-        (const_vector:V2DF [
-                (const_double:DF 0.0 [0x0.0p+0]) repeated x2
-            ])) "dbvufwcn.c":11:9# {movv2df_internal}
-     (nil))
-(insn # 0 0 2 (set (reg:V2DF 20 xmm0 [orig:84 a ] [84])
-        (vec_merge:V2DF (vec_duplicate:V2DF (float:DF (reg:SI 5 di [94])))
-            (reg:V2DF 20 xmm0 [orig:84 a ] [84])
-            (const_int 1 [0x1]))) "dbvufwcn.c":11:9# {sse2_cvtsi2sd}
-     (nil))
 (code_label # 0 0 3 4 (nil) [1 uses])
 (note # 0 0 [bb 3] NOTE_INSN_BASIC_BLOCK)
 (jump_insn # 0 0 3 (set (pc)

Reply via email to