public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/108784] New: '-fcompare-debug' failure (length) w/ -O1 -fharden-conditional-branches -funroll-all-loops --param ira-simple-lra-insn-threshold=1
@ 2023-02-14  5:58 asolokha at gmx dot com
  2023-02-23 14:13 ` [Bug debug/108784] '-fcompare-debug' failure (length) w/ " asolokha at gmx dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: asolokha at gmx dot com @ 2023-02-14  5:58 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108784
           Summary: '-fcompare-debug' failure (length) w/ -O1
                    -fharden-conditional-branches -funroll-all-loops
                    --param ira-simple-lra-insn-threshold=1
           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 54457
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54457&action=edit
gkd diff

gcc 13.0.1 20230212 snapshot (g:06ca0c9abb260266b688e2c2154c72214bb47076) fails
-fcompare-debug check when compiling the following testcase w/ -O1
-fharden-conditional-branches -funroll-all-loops --param
ira-simple-lra-insn-threshold=1:

int m;

void
foo (int x)
{
  int i;

  if (m)
    m += m;

  for (i = 0; i < 7; ++i)
    {
      __int128 a = 2;

      m += x * m && m / a;
    }

  while (x < 1)
    while (x < 1)
      ++x;
}

% aarch64-linux-gnu-gcc-13 -O1 -fcompare-debug -fharden-conditional-branches
-funroll-all-loops --param ira-simple-lra-insn-threshold=1 -c cdyfgse4.c
aarch64-linux-gnu-gcc-13: error: cdyfgse4.c: '-fcompare-debug' failure (length)

gkd diff attached.

W/ gcc 13.0.1 20230212 snapshot I get massive -fcompare-debug failures w/ all
kinds of test cases I have, either generated or real-world programs, when
compiling for aarch64-linux-gnu w/ ira-simple-lra-insn-threshold parameter
values ranging 1 to 3. I believe it has nothing to do w/
-fharden-conditional-branches, as there are many testcases that fail w/ that
omitted.

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

* [Bug debug/108784] '-fcompare-debug' failure (length) w/ --param ira-simple-lra-insn-threshold=1
  2023-02-14  5:58 [Bug debug/108784] New: '-fcompare-debug' failure (length) w/ -O1 -fharden-conditional-branches -funroll-all-loops --param ira-simple-lra-insn-threshold=1 asolokha at gmx dot com
@ 2023-02-23 14:13 ` asolokha at gmx dot com
  2023-03-26 19:45 ` aoliva at gcc dot gnu.org
  2023-03-27 12:15 ` asolokha at gmx dot com
  2 siblings, 0 replies; 4+ messages in thread
From: asolokha at gmx dot com @ 2023-02-23 14:13 UTC (permalink / raw)
  To: gcc-bugs

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

Arseny Solokha <asolokha at gmx dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|aarch64-linux-gnu           |aarch64-linux-gnu,
                   |                            |x86_64-unknown-linux-gnu
            Summary|'-fcompare-debug' failure   |'-fcompare-debug' failure
                   |(length) w/ -O1             |(length) w/ --param
                   |-fharden-conditional-branch |ira-simple-lra-insn-thresho
                   |es -funroll-all-loops       |ld=1
                   |--param                     |
                   |ira-simple-lra-insn-thresho |
                   |ld=1                        |

--- Comment #1 from Arseny Solokha <asolokha at gmx dot com> ---
(In reply to Arseny Solokha from comment #0)
> I believe it has nothing to do w/
> -fharden-conditional-branches, as there are many testcases that fail w/ that
> omitted.

Like the following one (though I get hundreds of them each day starting from
that snapshot):

int
foo (int x)
{
  int i, a = 0;

  x <<= !!x;

  for (i = 0; i < 7; ++i)
    {
      int i;

      for (i = 0; i < 12; ++i)
        {
          ++x;
          a += x + i;
        }
    }

  return x;
}

% gcc-13 -O1 -fcompare-debug --param ira-simple-lra-insn-threshold=1 -c
hqgybh5a.c
gcc-13: error: hqgybh5a.c: '-fcompare-debug' failure (length)

--- hqgybh5a.c.gkd      2023-02-23 21:10:57.181155878 +0700
+++ hqgybh5a.gk.c.gkd   2023-02-23 21:10:57.219153362 +0700
@@ -5,29 +5,36 @@
 (note # 0 0 NOTE_INSN_DELETED)
 (note # 0 0 [bb 2] NOTE_INSN_BASIC_BLOCK)
 (note # 0 0 NOTE_INSN_PROLOGUE_END)
+(insn # 0 0 2 (set (reg/v:SI 0 ax [orig:86 x ] [86])
+        (reg:SI 5 di [90])) "hqgybh5a.c":3:1# {*movsi_internal}
+     (nil))
 (note # 0 0 NOTE_INSN_FUNCTION_BEG)
 (insn # 0 0 2 (set (reg:CCZ 17 flags)
-        (compare:CCZ (reg/v:SI 5 di [orig:86 x ] [86])
+        (compare:CCZ (reg:SI 5 di [orig:86 x ] [86])
             (const_int 0 [0]))) "hqgybh5a.c":6:9# {*cmpsi_ccno_1}
-     (nil))
+     (expr_list:REG_DEAD (reg:SI 5 di [orig:86 x ] [86])
+        (nil)))
 (insn # 0 0 2 (set (reg:QI 2 cx [88])
         (ne:QI (reg:CCZ 17 flags)
             (const_int 0 [0]))) "hqgybh5a.c":6:9# {*setcc_qi}
      (expr_list:REG_DEAD (reg:CCZ 17 flags)
         (nil)))
 (insn # 0 0 2 (parallel [
-            (set (reg/v:SI 5 di [orig:84 x ] [84])
-                (ashift:SI (reg/v:SI 5 di [orig:86 x ] [86])
+            (set (reg/v:SI 0 ax [orig:84 x ] [84])
+                (ashift:SI (reg/v:SI 0 ax [orig:86 x ] [86])
                     (reg:QI 2 cx [88])))
             (clobber (reg:CC 17 flags))
         ]) "hqgybh5a.c":6:5# {*ashlsi3_1}
      (expr_list:REG_DEAD (reg:QI 2 cx [88])
         (expr_list:REG_UNUSED (reg:CC 17 flags)
             (nil))))
-(insn # 0 0 2 (set (reg:SI 0 ax [orig:89 x ] [89])
-        (plus:SI (reg/v:SI 5 di [orig:84 x ] [84])
-            (const_int 84 [0x54]))) "hqgybh5a.c":19:10 discrim 1# {*leasi}
-     (expr_list:REG_DEAD (reg/v:SI 5 di [orig:84 x ] [84])
+(insn # 0 0 2 (parallel [
+            (set (reg:SI 0 ax [orig:89 x ] [89])
+                (plus:SI (reg/v:SI 0 ax [orig:84 x ] [84])
+                    (const_int 84 [0x54])))
+            (clobber (reg:CC 17 flags))
+        ]) "hqgybh5a.c":19:10 discrim 1# {*addsi_1}
+     (expr_list:REG_UNUSED (reg:CC 17 flags)
         (nil)))
 (insn # 0 0 2 (use (reg/i:SI 0 ax)) "hqgybh5a.c":20:1#
      (nil))

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

* [Bug debug/108784] '-fcompare-debug' failure (length) w/ --param ira-simple-lra-insn-threshold=1
  2023-02-14  5:58 [Bug debug/108784] New: '-fcompare-debug' failure (length) w/ -O1 -fharden-conditional-branches -funroll-all-loops --param ira-simple-lra-insn-threshold=1 asolokha at gmx dot com
  2023-02-23 14:13 ` [Bug debug/108784] '-fcompare-debug' failure (length) w/ " asolokha at gmx dot com
@ 2023-03-26 19:45 ` aoliva at gcc dot gnu.org
  2023-03-27 12:15 ` asolokha at gmx dot com
  2 siblings, 0 replies; 4+ messages in thread
From: aoliva at gcc dot gnu.org @ 2023-03-26 19:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
Hello, Arseny,

I have a hunch this could possibly be related with fixed bug 108573.
Is this one by any chance fixed for you?

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

* [Bug debug/108784] '-fcompare-debug' failure (length) w/ --param ira-simple-lra-insn-threshold=1
  2023-02-14  5:58 [Bug debug/108784] New: '-fcompare-debug' failure (length) w/ -O1 -fharden-conditional-branches -funroll-all-loops --param ira-simple-lra-insn-threshold=1 asolokha at gmx dot com
  2023-02-23 14:13 ` [Bug debug/108784] '-fcompare-debug' failure (length) w/ " asolokha at gmx dot com
  2023-03-26 19:45 ` aoliva at gcc dot gnu.org
@ 2023-03-27 12:15 ` asolokha at gmx dot com
  2 siblings, 0 replies; 4+ messages in thread
From: asolokha at gmx dot com @ 2023-03-27 12:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Arseny Solokha <asolokha at gmx dot com> ---
(In reply to Alexandre Oliva from comment #2)
> Hello, Arseny,
> 
> I have a hunch this could possibly be related with fixed bug 108573.
> Is this one by any chance fixed for you?

No, I still get this failure in quite noticeable amounts w/ all recent weekly
snapshots. --param ira-simple-lra-insn-threshold=1 is necessary to trigger it.

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

end of thread, other threads:[~2023-03-27 12:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-14  5:58 [Bug debug/108784] New: '-fcompare-debug' failure (length) w/ -O1 -fharden-conditional-branches -funroll-all-loops --param ira-simple-lra-insn-threshold=1 asolokha at gmx dot com
2023-02-23 14:13 ` [Bug debug/108784] '-fcompare-debug' failure (length) w/ " asolokha at gmx dot com
2023-03-26 19:45 ` aoliva at gcc dot gnu.org
2023-03-27 12:15 ` asolokha at gmx dot com

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