public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/103756] New: [12 Regression] -fcompare-debug failure (length) with -O -fconserve-stack -frename-registers -fno-tree-ch -fira-algorithm=priority
@ 2021-12-17  8:11 zsojka at seznam dot cz
  2021-12-17  8:20 ` [Bug rtl-optimization/103756] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: zsojka at seznam dot cz @ 2021-12-17  8:11 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103756
           Summary: [12 Regression] -fcompare-debug failure (length) with
                    -O -fconserve-stack -frename-registers -fno-tree-ch
                    -fira-algorithm=priority
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
                CC: aoliva at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu

Created attachment 52022
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52022&action=edit
auto-reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fcompare-debug -fconserve-stack
-frename-registers -fno-tree-ch -fira-algorithm=priority testcase.C 
x86_64-pc-linux-gnu-gcc: error: testcase.C: '-fcompare-debug' failure (length)

$ diff -u *gkd
--- a-testcase.C.gkd    2021-12-17 09:05:04.178074934 +0100
+++ a-testcase.gk.C.gkd 2021-12-17 09:05:04.238074933 +0100
@@ -75,6 +75,9 @@
         ]) "testcase.C":21:25# {*subdi_1}
      (expr_list:REG_UNUSED (reg:CC 17 flags)
         (nil)))
+(insn # 0 0 2 (set (reg:DI 39 r11 [orig:91 _40 ] [91])
+        (reg/f:DI 5 di [orig:104 *__last_4(D).current ] [104]))
"testcase.C":21:25# {*movdi_internal}
+     (nil))
 (insn # 0 0 2 (set (reg:QI 38 r10 [orig:89 __copy_move_b___trans_tmp_9.1_32 ]
[89])
         (mem/c:QI (symbol_ref:DI ("__copy_move_b___trans_tmp_9") [flags 0x2] 
<var_decl # __copy_move_b___trans_tmp_9>) [ __copy_move_b___trans_tmp_9+0 S1
A8])) "testcase.C":29:24# {*movqi_internal}
      (nil))
@@ -84,7 +87,8 @@
 (insn # 0 0 2 (set (reg:SI 4 si [105])
         (plus:SI (reg:SI 36 r8 [orig:86 _13 ] [86])
             (reg:SI 5 di [orig:91 _40 ] [91]))) "testcase.C":27:16# {*leasi}
-     (nil))
+     (expr_list:REG_DEAD (reg:SI 5 di [orig:91 _40 ] [91])
+        (nil)))
 (jump_insn # 0 0 2 (set (pc)
         (label_ref #)) "testcase.C":27:5# {jump}
      (nil)
@@ -131,12 +135,12 @@
  -> 3)
 (note # 0 0 [bb 5] NOTE_INSN_BASIC_BLOCK)
 (insn # 0 0 5 (set (reg:DI 0 ax [orig:107 _40 ] [107])
-        (zero_extend:DI (reg:SI 5 di [orig:91 _40 ] [91]))) "testcase.C":9:45#
{*zero_extendsidi2}
+        (zero_extend:DI (reg:SI 39 r11 [orig:91 _40 ] [91])))
"testcase.C":9:45# {*zero_extendsidi2}
      (nil))
 (insn # 0 0 5 (set (reg:CCGOC 17 flags)
-        (compare:CCGOC (reg:SI 5 di [orig:91 _40 ] [91])
+        (compare:CCGOC (reg:SI 39 r11 [orig:91 _40 ] [91])
             (const_int 0 [0]))) "testcase.C":9:45# {*cmpsi_ccno_1}
-     (expr_list:REG_DEAD (reg:SI 5 di [orig:91 _40 ] [91])
+     (expr_list:REG_DEAD (reg:SI 39 r11 [orig:91 _40 ] [91])
         (nil)))
 (insn # 0 0 5 (set (reg:DI 2 cx [108])
         (const_int 0 [0])) "testcase.C":9:45# {*movdi_internal}

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r12-6031-20211217093444-g79a89108dd3-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-6031-20211217093444-g79a89108dd3-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20211217 (experimental) (GCC)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug rtl-optimization/103756] [12 Regression] -fcompare-debug failure (length) with -O -fconserve-stack -frename-registers -fno-tree-ch -fira-algorithm=priority
  2021-12-17  8:11 [Bug debug/103756] New: [12 Regression] -fcompare-debug failure (length) with -O -fconserve-stack -frename-registers -fno-tree-ch -fira-algorithm=priority zsojka at seznam dot cz
@ 2021-12-17  8:20 ` pinskia at gcc dot gnu.org
  2021-12-17  8:47 ` [Bug rtl-optimization/103756] [12 Regression] -fcompare-debug failure (length) with -O -fconserve-stack -frename-registers -fno-tree-ch -fira-algorithm=priority since r12-5978-ga888259a71fbbb7f marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-17  8:20 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ra, wrong-code
   Target Milestone|---                         |12.0
          Component|debug                       |rtl-optimization

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug rtl-optimization/103756] [12 Regression] -fcompare-debug failure (length) with -O -fconserve-stack -frename-registers -fno-tree-ch -fira-algorithm=priority since r12-5978-ga888259a71fbbb7f
  2021-12-17  8:11 [Bug debug/103756] New: [12 Regression] -fcompare-debug failure (length) with -O -fconserve-stack -frename-registers -fno-tree-ch -fira-algorithm=priority zsojka at seznam dot cz
  2021-12-17  8:20 ` [Bug rtl-optimization/103756] " pinskia at gcc dot gnu.org
@ 2021-12-17  8:47 ` marxin at gcc dot gnu.org
  2021-12-28 18:00 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-17  8:47 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[12 Regression]             |[12 Regression]
                   |-fcompare-debug failure     |-fcompare-debug failure
                   |(length) with -O            |(length) with -O
                   |-fconserve-stack            |-fconserve-stack
                   |-frename-registers          |-frename-registers
                   |-fno-tree-ch                |-fno-tree-ch
                   |-fira-algorithm=priority    |-fira-algorithm=priority
                   |                            |since
                   |                            |r12-5978-ga888259a71fbbb7f
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |rjiejie at me dot com
   Last reconfirmed|                            |2021-12-17
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r12-5978-ga888259a71fbbb7f.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug rtl-optimization/103756] [12 Regression] -fcompare-debug failure (length) with -O -fconserve-stack -frename-registers -fno-tree-ch -fira-algorithm=priority since r12-5978-ga888259a71fbbb7f
  2021-12-17  8:11 [Bug debug/103756] New: [12 Regression] -fcompare-debug failure (length) with -O -fconserve-stack -frename-registers -fno-tree-ch -fira-algorithm=priority zsojka at seznam dot cz
  2021-12-17  8:20 ` [Bug rtl-optimization/103756] " pinskia at gcc dot gnu.org
  2021-12-17  8:47 ` [Bug rtl-optimization/103756] [12 Regression] -fcompare-debug failure (length) with -O -fconserve-stack -frename-registers -fno-tree-ch -fira-algorithm=priority since r12-5978-ga888259a71fbbb7f marxin at gcc dot gnu.org
@ 2021-12-28 18:00 ` jakub at gcc dot gnu.org
  2021-12-30 21:26 ` cvs-commit at gcc dot gnu.org
  2021-12-30 21:28 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-12-28 18:00 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 52079
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52079&action=edit
gcc12-pr103756.patch

Untested fix.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug rtl-optimization/103756] [12 Regression] -fcompare-debug failure (length) with -O -fconserve-stack -frename-registers -fno-tree-ch -fira-algorithm=priority since r12-5978-ga888259a71fbbb7f
  2021-12-17  8:11 [Bug debug/103756] New: [12 Regression] -fcompare-debug failure (length) with -O -fconserve-stack -frename-registers -fno-tree-ch -fira-algorithm=priority zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2021-12-28 18:00 ` jakub at gcc dot gnu.org
@ 2021-12-30 21:26 ` cvs-commit at gcc dot gnu.org
  2021-12-30 21:28 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-12-30 21:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:6c684aa50d4eef28bb59ebb4664f362662845cd6

commit r12-6156-g6c684aa50d4eef28bb59ebb4664f362662845cd6
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Dec 30 22:25:34 2021 +0100

    regrename: Fix -fcompare-debug issue in find_rename_reg [PR103756]

    The r12-5978 change caused a -fcompare-debug issue, because without
    -g a chain might start with a noop move, but with -g there could be
    one or more DEBUG_INSNs in the chain before the noop move and so
    regrename could make different decisions between -g and -g0.

    Note, I must say I don't really understand the original change much,
    if we want to make sure the noop moves are removed, couldn't regrename
    during building of those du chains simply remove the noop moves instead?

    2021-12-30  Jakub Jelinek  <jakub@redhat.com>

            PR rtl-optimization/103756
            * regrename.c (find_rename_reg): Test noop_move_p on the first
            non-debug insn in the chain rather than on the first insn.

            * g++.dg/opt/pr103756.C: New test.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug rtl-optimization/103756] [12 Regression] -fcompare-debug failure (length) with -O -fconserve-stack -frename-registers -fno-tree-ch -fira-algorithm=priority since r12-5978-ga888259a71fbbb7f
  2021-12-17  8:11 [Bug debug/103756] New: [12 Regression] -fcompare-debug failure (length) with -O -fconserve-stack -frename-registers -fno-tree-ch -fira-algorithm=priority zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2021-12-30 21:26 ` cvs-commit at gcc dot gnu.org
@ 2021-12-30 21:28 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-12-30 21:28 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-12-30 21:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-17  8:11 [Bug debug/103756] New: [12 Regression] -fcompare-debug failure (length) with -O -fconserve-stack -frename-registers -fno-tree-ch -fira-algorithm=priority zsojka at seznam dot cz
2021-12-17  8:20 ` [Bug rtl-optimization/103756] " pinskia at gcc dot gnu.org
2021-12-17  8:47 ` [Bug rtl-optimization/103756] [12 Regression] -fcompare-debug failure (length) with -O -fconserve-stack -frename-registers -fno-tree-ch -fira-algorithm=priority since r12-5978-ga888259a71fbbb7f marxin at gcc dot gnu.org
2021-12-28 18:00 ` jakub at gcc dot gnu.org
2021-12-30 21:26 ` cvs-commit at gcc dot gnu.org
2021-12-30 21:28 ` jakub at gcc dot gnu.org

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).