public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/105653] New: [10/11/12/13 Regression] '-fcompare-debug' failure w/ -O2
@ 2022-05-19  6:18 asolokha at gmx dot com
  2022-05-19  6:21 ` [Bug debug/105653] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: asolokha at gmx dot com @ 2022-05-19  6:18 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105653
           Summary: [10/11/12/13 Regression] '-fcompare-debug' failure w/
                    -O2
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: compare-debug-failure
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---
            Target: aarch64-linux-gnu

Created attachment 52992
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52992&action=edit
Testcase

g++ 13.0.0 20220515 snapshot (g:18547874ee205d830acb31f1e3c1c89fc7725c14) fails
-fcompare-debug check when compiling the attached testcase w/ -O2:

% aarch64-linux-gnu-g++-13.0.0 -O2 -fcompare-debug -c q9dyty2d.cpp
aarch64-linux-gnu-g++-13.0.0: error: q9dyty2d.cpp: '-fcompare-debug' failure
(length)

gkd diff:

--- q9dyty2d.cpp.gkd    2022-05-19 13:16:40.109118502 +0700
+++ q9dyty2d.gk.cpp.gkd 2022-05-19 13:16:40.167118178 +0700
@@ -729,9 +729,7 @@
 (insn:TI # 0 0 (set (reg/f:DI 3 x3 [orig:113 MEM[(struct btVector3 * *)_31 +
8B] ] [113])
         (mem/f:DI (plus:DI (reg:DI 2 x2 [orig:101 D.xxxx ] [101])
                 (const_int 8 [0x8])) [ MEM[(struct btVector3 * *)_31 + 8B]+0
S8 A64])) "q9dyty2d.cpp":39:17# {*movdi_aarch64}
-     (expr_list:REG_EQUIV (mem/f:DI (plus:DI (reg:DI 2 x2 [orig:101 D.xxxx ]
[101])
-                (const_int 8 [0x8])) [ MEM[(struct btVector3 * *)_31 + 8B]+0
S8 A64])
-        (nil)))
+     (nil))
 (jump_insn:TI # 0 0 (set (pc)
         (if_then_else (ne (reg/f:DI 3 x3 [orig:113 MEM[(struct btVector3 *
*)_31 + 8B] ] [113])
                 (const_int 0 [0]))
@@ -899,9 +897,7 @@
 (insn:TI # 0 0 (set (reg/f:DI 3 x3 [orig:112 MEM[(struct btVector3 * *)_30 +
8B] ] [112])
         (mem/f:DI (plus:DI (reg:DI 2 x2 [orig:101 D.xxxx ] [101])
                 (const_int 8 [0x8])) [ MEM[(struct btVector3 * *)_30 + 8B]+0
S8 A64])) "q9dyty2d.cpp":39:17# {*movdi_aarch64}
-     (expr_list:REG_EQUIV (mem/f:DI (plus:DI (reg:DI 2 x2 [orig:101 D.xxxx ]
[101])
-                (const_int 8 [0x8])) [ MEM[(struct btVector3 * *)_30 + 8B]+0
S8 A64])
-        (nil)))
+     (nil))
 (jump_insn:TI # 0 0 (set (pc)
         (if_then_else (ne (reg/f:DI 3 x3 [orig:112 MEM[(struct btVector3 *
*)_30 + 8B] ] [112])
                 (const_int 0 [0]))

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

* [Bug debug/105653] [10/11/12/13 Regression] '-fcompare-debug' failure w/ -O2
  2022-05-19  6:18 [Bug debug/105653] New: [10/11/12/13 Regression] '-fcompare-debug' failure w/ -O2 asolokha at gmx dot com
@ 2022-05-19  6:21 ` rguenth at gcc dot gnu.org
  2022-06-28 10:49 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-19  6:21 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |10.4

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

* [Bug debug/105653] [10/11/12/13 Regression] '-fcompare-debug' failure w/ -O2
  2022-05-19  6:18 [Bug debug/105653] New: [10/11/12/13 Regression] '-fcompare-debug' failure w/ -O2 asolokha at gmx dot com
  2022-05-19  6:21 ` [Bug debug/105653] " rguenth at gcc dot gnu.org
@ 2022-06-28 10:49 ` jakub at gcc dot gnu.org
  2022-08-03  3:03 ` [Bug rtl-optimization/105653] " asolokha at gmx dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:49 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.4                        |10.5

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.

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

* [Bug rtl-optimization/105653] [10/11/12/13 Regression] '-fcompare-debug' failure w/ -O2
  2022-05-19  6:18 [Bug debug/105653] New: [10/11/12/13 Regression] '-fcompare-debug' failure w/ -O2 asolokha at gmx dot com
  2022-05-19  6:21 ` [Bug debug/105653] " rguenth at gcc dot gnu.org
  2022-06-28 10:49 ` jakub at gcc dot gnu.org
@ 2022-08-03  3:03 ` asolokha at gmx dot com
  2022-10-27  0:42 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: asolokha at gmx dot com @ 2022-08-03  3:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Arseny Solokha <asolokha at gmx dot com> ---
Created attachment 53403
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53403&action=edit
A shorter testcase

% aarch64-linux-gnu-g++-13.0.0 -O2 -fcompare-debug -fno-gcse -c wo91465u.cpp
aarch64-linux-gnu-g++-13.0.0: error: wo91465u.cpp: '-fcompare-debug' failure
(length)

--- wo91465u.cpp.gkd    2022-08-03 10:02:59.526593546 +0700
+++ wo91465u.gk.cpp.gkd 2022-08-03 10:02:59.554593642 +0700
@@ -47,10 +47,7 @@
         (zero_extend:DI (mem:SI (plus:DI (mult:DI (reg:DI 1 x1 [orig:96 D.xxxx
] [96])
                         (const_int 4 [0x4]))
                     (reg/f:DI 4 x4 [orig:93 _7 ] [93])) [ MEM[(int *)_7 +
ivtmp.6_16 * 4]+0 S4 A32]))) "wo91465u.cpp":10:7# {*zero_extendsidi2_aarch64}
-     (expr_list:REG_EQUIV (mem:SI (plus:DI (mult:DI (reg:DI 1 x1 [orig:96
D.xxxx ] [96])
-                    (const_int 4 [0x4]))
-                (reg/f:DI 4 x4 [orig:93 _7 ] [93])) [ MEM[(int *)_7 +
ivtmp.6_16 * 4]+0 S4 A32])
-        (nil)))
+     (nil))
 (jump_insn:TI # 0 0 (set (pc)
         (if_then_else (eq (reg:SI 2 x2 [orig:104 MEM[(int *)_7 + ivtmp.6_16 *
4] ] [104])
                 (const_int 0 [0]))

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

* [Bug rtl-optimization/105653] [10/11/12/13 Regression] '-fcompare-debug' failure w/ -O2
  2022-05-19  6:18 [Bug debug/105653] New: [10/11/12/13 Regression] '-fcompare-debug' failure w/ -O2 asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2022-08-03  3:03 ` [Bug rtl-optimization/105653] " asolokha at gmx dot com
@ 2022-10-27  0:42 ` pinskia at gcc dot gnu.org
  2022-12-20 13:46 ` rguenth at gcc dot gnu.org
  2023-07-07 10:43 ` [Bug rtl-optimization/105653] [11/12/13/14 " rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-27  0:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2022-10-27

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
IRA adds the REG_EQUIV note even for both with/without -g.

But it was removed in peephole2 for -g case.
In the -g case we get the following extra output in -g for peephole2 starting
with:

df_worklist_dataflow_doublequeue: n_basic_blocks 8 n_edges 10 count 9 (  1.1)
....
DCE: Deleting insn 15
deleting insn with uid = 15.
...

insn 15 was:
(insn:TI 15 13 16 2 (set (reg/f:DI 1 x1 [101])
        (plus:DI (reg/f:DI 0 x0 [orig:99 thisD.4083 ] [99])
            (const_int 8 [0x8]))) "/app/example.cpp":9:25 discrim 1 141
{*adddi3_aarch64}
     (expr_list:REG_UNUSED (reg/f:DI 1 x1 [101])
        (nil)))

in sched_fusion.

But in the -g0 case, it was not removed inside peephole2.

Someone who understands DF DCE better should look into this on why it was not
removed inside peephole2 without -g.

The instruction without -g:
(insn:TI 8 3 9 2 (set (reg/f:DI 1 x1 [101])
        (plus:DI (reg/f:DI 0 x0 [orig:99 this ] [99])
            (const_int 8 [0x8]))) "/app/example.cpp":9:25 discrim 1 141
{*adddi3_aarch64}
     (expr_list:REG_UNUSED (reg/f:DI 1 x1 [101])
        (nil)))

Which looks exactly the same even.

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

* [Bug rtl-optimization/105653] [10/11/12/13 Regression] '-fcompare-debug' failure w/ -O2
  2022-05-19  6:18 [Bug debug/105653] New: [10/11/12/13 Regression] '-fcompare-debug' failure w/ -O2 asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2022-10-27  0:42 ` pinskia at gcc dot gnu.org
@ 2022-12-20 13:46 ` rguenth at gcc dot gnu.org
  2023-07-07 10:43 ` [Bug rtl-optimization/105653] [11/12/13/14 " rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-12-20 13:46 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2

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

* [Bug rtl-optimization/105653] [11/12/13/14 Regression] '-fcompare-debug' failure w/ -O2
  2022-05-19  6:18 [Bug debug/105653] New: [10/11/12/13 Regression] '-fcompare-debug' failure w/ -O2 asolokha at gmx dot com
                   ` (4 preceding siblings ...)
  2022-12-20 13:46 ` rguenth at gcc dot gnu.org
@ 2023-07-07 10:43 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:43 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.5                        |11.5

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.

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

end of thread, other threads:[~2023-07-07 10:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-19  6:18 [Bug debug/105653] New: [10/11/12/13 Regression] '-fcompare-debug' failure w/ -O2 asolokha at gmx dot com
2022-05-19  6:21 ` [Bug debug/105653] " rguenth at gcc dot gnu.org
2022-06-28 10:49 ` jakub at gcc dot gnu.org
2022-08-03  3:03 ` [Bug rtl-optimization/105653] " asolokha at gmx dot com
2022-10-27  0:42 ` pinskia at gcc dot gnu.org
2022-12-20 13:46 ` rguenth at gcc dot gnu.org
2023-07-07 10:43 ` [Bug rtl-optimization/105653] [11/12/13/14 " rguenth 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).