public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "asolokha at gmx dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/103808] New: [12 Regression] '-fcompare-debug' failure (length) w/ -O2 -ftrapv
Date: Wed, 22 Dec 2021 17:08:06 +0000	[thread overview]
Message-ID: <bug-103808-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 103808
           Summary: [12 Regression] '-fcompare-debug' failure (length) w/
                    -O2 -ftrapv
           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/ -O2 -ftrapv:

void
foo (__int128 x, int y)
{
  for (;;)
    {
      __int128 a, b;

      x |= !!y;
      a = x + 1;
      b = y ? ++y : ++x;
      y = a < b;
      if (x >> 2)
        y *= 2;

      if (y == b)
        __builtin_unreachable ();
    }
}

% x86_64-unknown-linux-gnu-gcc-12.0.0 -O2 -fcompare-debug -ftrapv -c ddz9adk2.c
x86_64-unknown-linux-gnu-gcc-12.0.0: error: ddz9adk2.c: '-fcompare-debug'
failure (length)

--- ddz9adk2.c.gkd      2021-12-23 00:04:28.297518259 +0700
+++ ddz9adk2.gk.c.gkd   2021-12-23 00:04:28.387512439 +0700
@@ -6,11 +6,11 @@
 (note # 0 0 [bb 2] NOTE_INSN_BASIC_BLOCK)
 (note # 0 0 NOTE_INSN_DELETED)
 (note # 0 0 NOTE_INSN_DELETED)
-(insn/f:TI # 0 0 2 (set (mem:DI (pre_dec:DI (reg/f:DI 7 sp)) [  S8 A8])
+(insn/f:TI # 0 0 2 (set (mem:DI (pre_dec:DI (reg/f:DI 7 sp [ x+8 ])) [  S8
A8])
         (reg:DI 42 r14)) "ddz9adk2.c":3:1# {*pushdi2_rex64}
      (expr_list:REG_DEAD (reg:DI 42 r14)
         (nil)))
-(insn/f:TI # 0 0 2 (set (mem:DI (pre_dec:DI (reg/f:DI 7 sp)) [  S8 A8])
+(insn/f:TI # 0 0 2 (set (mem:DI (pre_dec:DI (reg/f:DI 7 sp [ x+8 ])) [  S8
A8])
         (reg:DI 41 r13)) "ddz9adk2.c":3:1# {*pushdi2_rex64}
      (expr_list:REG_DEAD (reg:DI 41 r13)
         (nil)))
@@ -18,7 +18,7 @@
         (reg:DI 4 si [123])) "ddz9adk2.c":3:1# {*movdi_internal}
      (expr_list:REG_DEAD (reg:DI 4 si [123])
         (nil)))
-(insn/f:TI # 0 0 2 (set (mem:DI (pre_dec:DI (reg/f:DI 7 sp)) [  S8 A8])
+(insn/f:TI # 0 0 2 (set (mem:DI (pre_dec:DI (reg/f:DI 7 sp [ x+8 ])) [  S8
A8])
         (reg:DI 40 r12)) "ddz9adk2.c":3:1# {*pushdi2_rex64}
      (expr_list:REG_DEAD (reg:DI 40 r12)
         (nil)))
@@ -26,11 +26,11 @@
         (reg:DI 5 di [122])) "ddz9adk2.c":3:1# {*movdi_internal}
      (expr_list:REG_DEAD (reg:DI 5 di [122])
         (nil)))
-(insn/f:TI # 0 0 2 (set (mem:DI (pre_dec:DI (reg/f:DI 7 sp)) [  S8 A8])
+(insn/f:TI # 0 0 2 (set (mem:DI (pre_dec:DI (reg/f:DI 7 sp [ x+8 ])) [  S8
A8])
         (reg:DI 6 bp)) "ddz9adk2.c":3:1# {*pushdi2_rex64}
      (expr_list:REG_DEAD (reg:DI 6 bp)
         (nil)))
-(insn/f:TI # 0 0 2 (set (mem:DI (pre_dec:DI (reg/f:DI 7 sp)) [  S8 A8])
+(insn/f:TI # 0 0 2 (set (mem:DI (pre_dec:DI (reg/f:DI 7 sp [ x+8 ])) [  S8
A8])
         (reg:DI 3 bx)) "ddz9adk2.c":3:1# {*pushdi2_rex64}
      (expr_list:REG_DEAD (reg:DI 3 bx)
         (nil)))

             reply	other threads:[~2021-12-22 17:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-22 17:08 asolokha at gmx dot com [this message]
2021-12-22 21:18 ` [Bug middle-end/103808] " pinskia at gcc dot gnu.org
2021-12-22 23:34 ` [Bug target/103808] " pinskia at gcc dot gnu.org
2021-12-22 23:36 ` pinskia at gcc dot gnu.org
2021-12-22 23:57 ` pinskia at gcc dot gnu.org
2021-12-23  8:32 ` [Bug target/103808] [12 Regression] '-fcompare-debug' failure (length) w/ -O2 -ftrapv since r12-5944-ga7acb6dca941db2b marxin at gcc dot gnu.org
2021-12-28 18:37 ` jakub at gcc dot gnu.org
2021-12-30 13:36 ` [Bug debug/103808] " cvs-commit at gcc dot gnu.org
2021-12-30 13:40 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-103808-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).