public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/104180] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O1
@ 2022-01-22  8:31 asolokha at gmx dot com
  2022-01-22 11:13 ` [Bug debug/104180] " jakub at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: asolokha at gmx dot com @ 2022-01-22  8:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104180
           Summary: [10/11/12 Regression] '-fcompare-debug' failure
                    (length) w/ -O1
           Product: gcc
           Version: 12.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: ---

g++ 12.0.0 20220109 snapshot (g:90045c5df5b3c8853e7740fb72a11aead1c489bb) fails
-fcompare-debug check when compiling the following testcase, reduced from
gcc/testsuite/gcc.dg/torture/pr89223.c, w/ -O1:

int a[5];

void
c ()
{
  unsigned int b;

  for (b = 3; ; b--)
    a[b] = ({ a[b + 1]; });
}

% g++-12.0.0 -O1 -fcompare-debug -c lluhupiv.c
g++-12.0.0: error: lluhupiv.c: '-fcompare-debug' failure (length)

--- lluhupiv.c.gkd      2022-01-22 15:27:16.168639041 +0700
+++ lluhupiv.gk.c.gkd   2022-01-22 15:27:16.239634334 +0700
@@ -33,7 +33,7 @@
      (nil))
 (insn # 0 0 3 (set (mem:SI (plus:DI (mult:DI (reg:DI 2 cx [orig:87 b ] [87])
                     (const_int 4 [0x4]))
-                (reg/f:DI 5 di [86])) [ a[b_3]+0 S4 A32])
+                (reg/f:DI 5 di [86])) [ MEM <int[5]> [(int *)&a][b_3]+0 S4
A32])
         (reg:SI 4 si [orig:82 _2 ] [82])) "lluhupiv.c":9:10# {*movsi_internal}
      (expr_list:REG_DEAD (reg:SI 4 si [orig:82 _2 ] [82])
         (expr_list:REG_DEAD (reg:DI 2 cx [orig:87 b ] [87])

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

* [Bug debug/104180] [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O1
  2022-01-22  8:31 [Bug debug/104180] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O1 asolokha at gmx dot com
@ 2022-01-22 11:13 ` jakub at gcc dot gnu.org
  2022-01-22 12:06 ` [Bug c++/104180] " pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-01-22 11:13 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-01-22
   Target Milestone|---                         |10.4
             Status|UNCONFIRMED                 |NEW
                 CC|                            |jakub at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r11-963-g80d6f89e78fc3b772701988cc73aa8e8006283be
which has been backported to 10.x in r10-8355-g7d919c33fbd29

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

* [Bug c++/104180] [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O1
  2022-01-22  8:31 [Bug debug/104180] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O1 asolokha at gmx dot com
  2022-01-22 11:13 ` [Bug debug/104180] " jakub at gcc dot gnu.org
@ 2022-01-22 12:06 ` pinskia at gcc dot gnu.org
  2022-01-22 12:07 ` pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-01-22 12:06 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|middle-end                  |c++

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
[apinski@xeond2 src]$ diff -up t.cc.*original t.gk.cc.*original |less
--- t.cc.005t.original  2022-01-22 03:44:26.901343652 -0800
+++ t.gk.cc.005t.original       2022-01-22 03:44:27.005343663 -0800
@@ -6,13 +6,19 @@
 {
   unsigned int b;

+  # DEBUG BEGIN STMT;
     unsigned int b;
+  # DEBUG BEGIN STMT;
   <<cleanup_point <<< Unknown tree: expr_stmt
     (void) (b = 3) >>>>>;
   <D.2374>:;
+  # DEBUG BEGIN STMT;
   <<cleanup_point <<< Unknown tree: expr_stmt
-    (void) (a[b] = a[b + 1]) >>>>>;
+    (void) (a[b] = # DEBUG BEGIN STMT;
+    a[b + 1];) >>>>>;
+  # DEBUG BEGIN STMT;
   <<cleanup_point (void) b-- >>;
+  # DEBUG BEGIN STMT;
   goto <D.2374>;
 }



And then we gimplify:
+  # DEBUG BEGIN_STMT
+  # DEBUG BEGIN_STMT
   b = 3;
   <D.2374>:
-  _1 = b + 1;
-  _2 = a[_1];
-  a[b] = _2;
+  # DEBUG BEGIN_STMT
+  _1 = &a[b];
+  # DEBUG BEGIN_STMT
+  _2 = b + 1;
+  _3 = a[_2];
+  *_1 = _3;
+  # DEBUG BEGIN_STMT
   b = b + 4294967295;
+  # DEBUG BEGIN_STMT
   goto <D.2374>;

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

* [Bug c++/104180] [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O1
  2022-01-22  8:31 [Bug debug/104180] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O1 asolokha at gmx dot com
  2022-01-22 11:13 ` [Bug debug/104180] " jakub at gcc dot gnu.org
  2022-01-22 12:06 ` [Bug c++/104180] " pinskia at gcc dot gnu.org
@ 2022-01-22 12:07 ` pinskia at gcc dot gnu.org
  2022-01-22 12:19 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-01-22 12:07 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=100733,
                   |                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=103788

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Similar in nature to PR 100733 and PR 103788.

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

* [Bug c++/104180] [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O1
  2022-01-22  8:31 [Bug debug/104180] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O1 asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2022-01-22 12:07 ` pinskia at gcc dot gnu.org
@ 2022-01-22 12:19 ` jakub at gcc dot gnu.org
  2022-01-24  9:10 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-01-22 12:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aoliva at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
If it is because of -gstatement-frontiers, I've ran out of ideas how to fix
them.
So unless Alexandre is willing to look at it, I'd suggest to at least turn
-gstatement-frontiers off by default.

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

* [Bug c++/104180] [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O1
  2022-01-22  8:31 [Bug debug/104180] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O1 asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2022-01-22 12:19 ` jakub at gcc dot gnu.org
@ 2022-01-24  9:10 ` rguenth at gcc dot gnu.org
  2022-01-24  9:30 ` asolokha at gmx dot com
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-24  9:10 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
                 CC|                            |rguenth at gcc dot gnu.org

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think it's reasonable to turn them off (OTOH we then probably lose all test
coverage).  IIRC gdb doensn't handle any of the advanced debug stuff GCC emits
(like views)?

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

* [Bug c++/104180] [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O1
  2022-01-22  8:31 [Bug debug/104180] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O1 asolokha at gmx dot com
                   ` (4 preceding siblings ...)
  2022-01-24  9:10 ` rguenth at gcc dot gnu.org
@ 2022-01-24  9:30 ` asolokha at gmx dot com
  2022-02-17  6:23 ` aoliva at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: asolokha at gmx dot com @ 2022-01-24  9:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Arseny Solokha <asolokha at gmx dot com> ---
Meanwhile, I've finally added -gno-statement-frontiers to my testing scripts.

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

* [Bug c++/104180] [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O1
  2022-01-22  8:31 [Bug debug/104180] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O1 asolokha at gmx dot com
                   ` (5 preceding siblings ...)
  2022-01-24  9:30 ` asolokha at gmx dot com
@ 2022-02-17  6:23 ` aoliva at gcc dot gnu.org
  2022-06-28 10:47 ` [Bug c++/104180] [10/11/12/13 " jakub at gcc dot gnu.org
  2023-07-07 10:42 ` [Bug c++/104180] [11/12/13/14 " rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: aoliva at gcc dot gnu.org @ 2022-02-17  6:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
I've recommended before that, without any plan to implement consumers for this
debug information, keeping it in place is mostly wasteful.  AFAICT other debug
stmts issued by front-ends could hit the same issue, but those are only
theoretical IIRC.  On the one hand, disabling the feature would hide the known
problem that codegen is sensitive to such debug stmts, but on the other, we can
cross that bridge if we get to it again.

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

* [Bug c++/104180] [10/11/12/13 Regression] '-fcompare-debug' failure (length) w/ -O1
  2022-01-22  8:31 [Bug debug/104180] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O1 asolokha at gmx dot com
                   ` (6 preceding siblings ...)
  2022-02-17  6:23 ` aoliva at gcc dot gnu.org
@ 2022-06-28 10:47 ` jakub at gcc dot gnu.org
  2023-07-07 10:42 ` [Bug c++/104180] [11/12/13/14 " rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:47 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #8 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] 10+ messages in thread

* [Bug c++/104180] [11/12/13/14 Regression] '-fcompare-debug' failure (length) w/ -O1
  2022-01-22  8:31 [Bug debug/104180] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O1 asolokha at gmx dot com
                   ` (7 preceding siblings ...)
  2022-06-28 10:47 ` [Bug c++/104180] [10/11/12/13 " jakub at gcc dot gnu.org
@ 2023-07-07 10:42 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

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

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-22  8:31 [Bug debug/104180] New: [10/11/12 Regression] '-fcompare-debug' failure (length) w/ -O1 asolokha at gmx dot com
2022-01-22 11:13 ` [Bug debug/104180] " jakub at gcc dot gnu.org
2022-01-22 12:06 ` [Bug c++/104180] " pinskia at gcc dot gnu.org
2022-01-22 12:07 ` pinskia at gcc dot gnu.org
2022-01-22 12:19 ` jakub at gcc dot gnu.org
2022-01-24  9:10 ` rguenth at gcc dot gnu.org
2022-01-24  9:30 ` asolokha at gmx dot com
2022-02-17  6:23 ` aoliva at gcc dot gnu.org
2022-06-28 10:47 ` [Bug c++/104180] [10/11/12/13 " jakub at gcc dot gnu.org
2023-07-07 10:42 ` [Bug c++/104180] [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).