public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/103742] New: [12 Regression] '-fcompare-debug' failure (length) with -O2 -fnon-call-exceptions --param=early-inlining-insns=82
@ 2021-12-16  5:44 zsojka at seznam dot cz
  2021-12-16  6:52 ` [Bug debug/103742] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: zsojka at seznam dot cz @ 2021-12-16  5:44 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103742
           Summary: [12 Regression] '-fcompare-debug' failure (length)
                    with -O2 -fnon-call-exceptions
                    --param=early-inlining-insns=82
           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: ---

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -fnon-call-exceptions
--param=early-inlining-insns=82 -fcompare-debug testcase.C
x86_64-pc-linux-gnu-gcc: error: testcase.C: '-fcompare-debug' failure

$ diff -u *gkd
--- a-testcase.C.gkd    2021-12-16 06:38:14.832032631 +0100
+++ a-testcase.gk.C.gkd 2021-12-16 06:38:14.912032192 +0100
@@ -279,7 +279,7 @@
      (expr_list:REG_EQUAL (plus:DI (reg/f:DI 19 frame)
             (const_int -16 [0xfffffffffffffff0]))
         (nil)))
-(code_label # 0 0 4 18 (nil) [1 uses])
+(code_label # 0 0 4 19 (nil) [1 uses])
 (note # 0 0 [bb 4] NOTE_INSN_BASIC_BLOCK)
 (insn:TI # 0 0 4 (set (reg:DI 1 dx [orig:87 _9 ] [87])
         (mem:DI (reg/f:DI 0 ax [orig:86 iftmp.4_8 ] [86]) [
*iftmp.4_8.m_value+0 S8 A64])) "testcase.C":5:61# {*movdi_internal}
@@ -340,6 +340,6 @@
 (jump_insn # 0 0 5 (set (pc)
         (label_ref #))# {jump}
      (nil)
- -> 18)
+ -> 19)
 (barrier # 0 0)
 (note # 0 0 NOTE_INSN_DELETED)

$ 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-6011-20211215204558-gab18659afc0-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-6011-20211215204558-gab18659afc0-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20211216 (experimental) (GCC)

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

* [Bug debug/103742] [12 Regression] '-fcompare-debug' failure (length) with -O2 -fnon-call-exceptions --param=early-inlining-insns=82
  2021-12-16  5:44 [Bug debug/103742] New: [12 Regression] '-fcompare-debug' failure (length) with -O2 -fnon-call-exceptions --param=early-inlining-insns=82 zsojka at seznam dot cz
@ 2021-12-16  6:52 ` pinskia at gcc dot gnu.org
  2021-12-16 10:04 ` [Bug debug/103742] [12 Regression] '-fcompare-debug' failure (length) with -O2 -fnon-call-exceptions --param=early-inlining-insns=82 since r12-5301-g045206450386bcd7 marxin at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-16  6:52 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0
           Keywords|                            |ice-on-valid-code

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

* [Bug debug/103742] [12 Regression] '-fcompare-debug' failure (length) with -O2 -fnon-call-exceptions --param=early-inlining-insns=82 since r12-5301-g045206450386bcd7
  2021-12-16  5:44 [Bug debug/103742] New: [12 Regression] '-fcompare-debug' failure (length) with -O2 -fnon-call-exceptions --param=early-inlining-insns=82 zsojka at seznam dot cz
  2021-12-16  6:52 ` [Bug debug/103742] " pinskia at gcc dot gnu.org
@ 2021-12-16 10:04 ` marxin at gcc dot gnu.org
  2021-12-28 15:03 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-16 10:04 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-12-16
            Summary|[12 Regression]             |[12 Regression]
                   |'-fcompare-debug' failure   |'-fcompare-debug' failure
                   |(length) with -O2           |(length) with -O2
                   |-fnon-call-exceptions       |-fnon-call-exceptions
                   |--param=early-inlining-insn |--param=early-inlining-insn
                   |s=82                        |s=82 since
                   |                            |r12-5301-g045206450386bcd7

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

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

* [Bug debug/103742] [12 Regression] '-fcompare-debug' failure (length) with -O2 -fnon-call-exceptions --param=early-inlining-insns=82 since r12-5301-g045206450386bcd7
  2021-12-16  5:44 [Bug debug/103742] New: [12 Regression] '-fcompare-debug' failure (length) with -O2 -fnon-call-exceptions --param=early-inlining-insns=82 zsojka at seznam dot cz
  2021-12-16  6:52 ` [Bug debug/103742] " pinskia at gcc dot gnu.org
  2021-12-16 10:04 ` [Bug debug/103742] [12 Regression] '-fcompare-debug' failure (length) with -O2 -fnon-call-exceptions --param=early-inlining-insns=82 since r12-5301-g045206450386bcd7 marxin at gcc dot gnu.org
@ 2021-12-28 15:03 ` jakub at gcc dot gnu.org
  2021-12-28 16:37 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-12-28 15:03 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Doesn't reproduce since r12-6031-g79a89108dd352cd9288f5de35481b1280c7588a5 .

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

* [Bug debug/103742] [12 Regression] '-fcompare-debug' failure (length) with -O2 -fnon-call-exceptions --param=early-inlining-insns=82 since r12-5301-g045206450386bcd7
  2021-12-16  5:44 [Bug debug/103742] New: [12 Regression] '-fcompare-debug' failure (length) with -O2 -fnon-call-exceptions --param=early-inlining-insns=82 zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2021-12-28 15:03 ` jakub at gcc dot gnu.org
@ 2021-12-28 16:37 ` jakub at gcc dot gnu.org
  2021-12-28 17:22 ` zsojka at seznam dot cz
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-12-28 16:37 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

Untested fix that fixes it in the r12-6030 tree.

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

* [Bug debug/103742] [12 Regression] '-fcompare-debug' failure (length) with -O2 -fnon-call-exceptions --param=early-inlining-insns=82 since r12-5301-g045206450386bcd7
  2021-12-16  5:44 [Bug debug/103742] New: [12 Regression] '-fcompare-debug' failure (length) with -O2 -fnon-call-exceptions --param=early-inlining-insns=82 zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2021-12-28 16:37 ` jakub at gcc dot gnu.org
@ 2021-12-28 17:22 ` zsojka at seznam dot cz
  2021-12-29 20:47 ` cvs-commit at gcc dot gnu.org
  2021-12-29 20:56 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: zsojka at seznam dot cz @ 2021-12-28 17:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Zdenek Sojka <zsojka at seznam dot cz> ---
(In reply to Jakub Jelinek from comment #3)
> Created attachment 52078 [details]
> gcc12-pr103742.patch
> 
> Untested fix that fixes it in the r12-6030 tree.

Thank you for the patch. It fixes both the reduced and original unreduced
testcase when applied on r12-6030.

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

* [Bug debug/103742] [12 Regression] '-fcompare-debug' failure (length) with -O2 -fnon-call-exceptions --param=early-inlining-insns=82 since r12-5301-g045206450386bcd7
  2021-12-16  5:44 [Bug debug/103742] New: [12 Regression] '-fcompare-debug' failure (length) with -O2 -fnon-call-exceptions --param=early-inlining-insns=82 zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2021-12-28 17:22 ` zsojka at seznam dot cz
@ 2021-12-29 20:47 ` cvs-commit at gcc dot gnu.org
  2021-12-29 20:56 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-12-29 20:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 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:e5acfcad98f3fa33e141f4e6bc06f7d7c13496e1

commit r12-6146-ge5acfcad98f3fa33e141f4e6bc06f7d7c13496e1
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Dec 29 21:46:21 2021 +0100

    tree-ssa-dce: Fix up -fcompare-debug failures in
make_forwarders_with_degenerate_phis [PR103742]

    make_forwarders_with_degenerate_phis causes a -fcompare-debug failure on
the
    following testcase.
    The problem is that on:
      # iftmp.4_8 = PHI <&D.2582(6), &D.2583(4), &D.2582(7), &D.2583(5)>
    the exact DECL_UIDs are different between -g and -g0 (which is ok, with -g
    the decls can have larger gaps in between the uids), which means
    iterative_hash_expr is different and because there are 2 pairs of edges
    with matching phi arguments, the function processes them in different
    orders.
    The following patch fixes it by using the iterative_hash_expr order
    only to determine which arguments are the same, then replaces the hashes
    with the minimum dest_idx in the set of matching arguments and qsorts
    again (which makes it stable for -fcompare-debug) and only splits edges
etc.
    on that stable order.
    As a small optimization, if no arguments are equal, it doesn't do the
    second qsort and continues, and if all arguments of the PHI are
    constants or SSA_NAMEs (I think that is a pretty common case for many
    PHIs), then it doesn't do the second qsort either, because in that case
    the hash values will be stable, only computed from the constant values or
    SSA_NAME_VERSIONs.

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

            PR debug/103742
            * tree-ssa-dce.c (make_forwarders_with_degenerate_phis): If any phi
            argument is not CONSTANT_CLASS_P or SSA_NAME and any arguments are
            equal, change second from hash value to lowest dest_idx from the
            edges which have equal argument and resort to ensure
-fcompare-debug
            stability.

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

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

* [Bug debug/103742] [12 Regression] '-fcompare-debug' failure (length) with -O2 -fnon-call-exceptions --param=early-inlining-insns=82 since r12-5301-g045206450386bcd7
  2021-12-16  5:44 [Bug debug/103742] New: [12 Regression] '-fcompare-debug' failure (length) with -O2 -fnon-call-exceptions --param=early-inlining-insns=82 zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2021-12-29 20:47 ` cvs-commit at gcc dot gnu.org
@ 2021-12-29 20:56 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-12-29 20:56 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

end of thread, other threads:[~2021-12-29 20:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-16  5:44 [Bug debug/103742] New: [12 Regression] '-fcompare-debug' failure (length) with -O2 -fnon-call-exceptions --param=early-inlining-insns=82 zsojka at seznam dot cz
2021-12-16  6:52 ` [Bug debug/103742] " pinskia at gcc dot gnu.org
2021-12-16 10:04 ` [Bug debug/103742] [12 Regression] '-fcompare-debug' failure (length) with -O2 -fnon-call-exceptions --param=early-inlining-insns=82 since r12-5301-g045206450386bcd7 marxin at gcc dot gnu.org
2021-12-28 15:03 ` jakub at gcc dot gnu.org
2021-12-28 16:37 ` jakub at gcc dot gnu.org
2021-12-28 17:22 ` zsojka at seznam dot cz
2021-12-29 20:47 ` cvs-commit at gcc dot gnu.org
2021-12-29 20:56 ` 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).