public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/95080] New: [10/11 Regression] -fcompare-debug failure (length) with -Og -fcse-follow-jumps -fnon-call-exceptions
@ 2020-05-12 11:17 zsojka at seznam dot cz
  2020-05-12 11:24 ` [Bug debug/95080] " rguenth at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: zsojka at seznam dot cz @ 2020-05-12 11:17 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95080
           Summary: [10/11 Regression] -fcompare-debug failure (length)
                    with -Og -fcse-follow-jumps -fnon-call-exceptions
           Product: gcc
           Version: 11.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 48517
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48517&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-g++ -Og -fcse-follow-jumps -fnon-call-exceptions
-fcompare-debug testcase.C
x86_64-pc-linux-gnu-g++: error: testcase.C: '-fcompare-debug' failure (length)

$ diff -u testcase.gkd testcase.gk.gkd 
--- testcase.gkd        2020-05-12 13:14:06.626740964 +0200
+++ testcase.gk.gkd     2020-05-12 13:14:06.716740965 +0200
@@ -51,12 +51,10 @@
         (reg:DI 5 di [93]))# {*movdi_internal}
      (expr_list:REG_DEAD (reg:DI 5 di [93])
         (nil)))
-(insn # 0 0 4 (set (reg:QI 0 ax [orig:86 _11 ] [86])
-        (const_int 0 [0])) "testcase.C":8:14# {*movqi_internal}
+(insn # 0 0 4 (set (reg:QI 0 ax [orig:89 _14 ] [89])
+        (const_int 0 [0])) "testcase.C":15:14# {*movqi_internal}
      (expr_list:REG_EQUIV (const_int 0 [0])
-        (expr_list:REG_EH_REGION (const_int -1 [0xffffffffffffffff])
-            (nil))))
-(note # 0 0 NOTE_INSN_DELETED)
+        (nil)))
 (insn # 0 0 4 (set (reg:CCZ 17 flags)
         (compare:CCZ (reg:QI 0 ax [orig:89 _14 ] [89])
             (const_int 0 [0]))) "testcase.C":22:3# {*cmpqi_ccno_1}

$ x86_64-pc-linux-gnu-g++ -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest/bin/x86_64-pc-linux-gnu-g++
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r11-314-20200512100527-g99b0c9ec47d-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.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
--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-r11-314-20200512100527-g99b0c9ec47d-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.0.0 20200512 (experimental) (GCC)

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

* [Bug debug/95080] [10/11 Regression] -fcompare-debug failure (length) with -Og -fcse-follow-jumps -fnon-call-exceptions
  2020-05-12 11:17 [Bug debug/95080] New: [10/11 Regression] -fcompare-debug failure (length) with -Og -fcse-follow-jumps -fnon-call-exceptions zsojka at seznam dot cz
@ 2020-05-12 11:24 ` rguenth at gcc dot gnu.org
  2020-05-12 16:47 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-05-12 11:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |10.2

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

* [Bug debug/95080] [10/11 Regression] -fcompare-debug failure (length) with -Og -fcse-follow-jumps -fnon-call-exceptions
  2020-05-12 11:17 [Bug debug/95080] New: [10/11 Regression] -fcompare-debug failure (length) with -Og -fcse-follow-jumps -fnon-call-exceptions zsojka at seznam dot cz
  2020-05-12 11:24 ` [Bug debug/95080] " rguenth at gcc dot gnu.org
@ 2020-05-12 16:47 ` jakub at gcc dot gnu.org
  2020-05-12 19:07 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-05-12 16:47 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r10-3542-g0b92cf305dcf34387a8e2564e55ca8948df3b47a 
Given that, most likely latent before.

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

* [Bug debug/95080] [10/11 Regression] -fcompare-debug failure (length) with -Og -fcse-follow-jumps -fnon-call-exceptions
  2020-05-12 11:17 [Bug debug/95080] New: [10/11 Regression] -fcompare-debug failure (length) with -Og -fcse-follow-jumps -fnon-call-exceptions zsojka at seznam dot cz
  2020-05-12 11:24 ` [Bug debug/95080] " rguenth at gcc dot gnu.org
  2020-05-12 16:47 ` jakub at gcc dot gnu.org
@ 2020-05-12 19:07 ` jakub at gcc dot gnu.org
  2020-05-13  9:23 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-05-12 19:07 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-05-12
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
     Ever confirmed|0                           |1

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

Untested fix.

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

* [Bug debug/95080] [10/11 Regression] -fcompare-debug failure (length) with -Og -fcse-follow-jumps -fnon-call-exceptions
  2020-05-12 11:17 [Bug debug/95080] New: [10/11 Regression] -fcompare-debug failure (length) with -Og -fcse-follow-jumps -fnon-call-exceptions zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2020-05-12 19:07 ` jakub at gcc dot gnu.org
@ 2020-05-13  9:23 ` cvs-commit at gcc dot gnu.org
  2020-05-13  9:24 ` [Bug debug/95080] [10 " jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-05-13  9:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:18edc195442291525e04f0fa4d5ef972155117da

commit r11-351-g18edc195442291525e04f0fa4d5ef972155117da
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed May 13 11:22:37 2020 +0200

    Fix -fcompare-debug issue in purge_dead_edges [PR95080]

    The following testcase fails with -fcompare-debug, the bug used to be
latent
    since introduction of -fcompare-debug.
    The loop at the start of purge_dead_edges behaves differently between -g0
    and -g - if the last insn is a DEBUG_INSN, then it skips not just
    DEBUG_INSNs but also NOTEs until it finds some other real insn (or bb
head),
    while with -g0 it will not skip any NOTEs, so if we have
    real_insn
    note
    debug_insn // not present with -g0
    then with -g it might remove useless REG_EH_REGION from real_insn, while
    with -g0 it will not.

    Yet another option would be not skipping NOTE_P in the loop; I couldn't
find
    in history rationale for why it is done.

    2020-05-13  Jakub Jelinek  <jakub@redhat.com>

            PR debug/95080
            * cfgrtl.c (purge_dead_edges): Skip over debug and note insns even
            if the last insn is a note.

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

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

* [Bug debug/95080] [10 Regression] -fcompare-debug failure (length) with -Og -fcse-follow-jumps -fnon-call-exceptions
  2020-05-12 11:17 [Bug debug/95080] New: [10/11 Regression] -fcompare-debug failure (length) with -Og -fcse-follow-jumps -fnon-call-exceptions zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2020-05-13  9:23 ` cvs-commit at gcc dot gnu.org
@ 2020-05-13  9:24 ` jakub at gcc dot gnu.org
  2020-06-14 10:07 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-05-13  9:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[10/11 Regression]          |[10 Regression]
                   |-fcompare-debug failure     |-fcompare-debug failure
                   |(length) with -Og           |(length) with -Og
                   |-fcse-follow-jumps          |-fcse-follow-jumps
                   |-fnon-call-exceptions       |-fnon-call-exceptions

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 11+ so far.

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

* [Bug debug/95080] [10 Regression] -fcompare-debug failure (length) with -Og -fcse-follow-jumps -fnon-call-exceptions
  2020-05-12 11:17 [Bug debug/95080] New: [10/11 Regression] -fcompare-debug failure (length) with -Og -fcse-follow-jumps -fnon-call-exceptions zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2020-05-13  9:24 ` [Bug debug/95080] [10 " jakub at gcc dot gnu.org
@ 2020-06-14 10:07 ` cvs-commit at gcc dot gnu.org
  2020-06-14 11:46 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-14 10:07 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:16710ff9803bc48aabdfecce30866ffac6d29342

commit r10-8292-g16710ff9803bc48aabdfecce30866ffac6d29342
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed May 13 11:22:37 2020 +0200

    Fix -fcompare-debug issue in purge_dead_edges [PR95080]

    The following testcase fails with -fcompare-debug, the bug used to be
latent
    since introduction of -fcompare-debug.
    The loop at the start of purge_dead_edges behaves differently between -g0
    and -g - if the last insn is a DEBUG_INSN, then it skips not just
    DEBUG_INSNs but also NOTEs until it finds some other real insn (or bb
head),
    while with -g0 it will not skip any NOTEs, so if we have
    real_insn
    note
    debug_insn // not present with -g0
    then with -g it might remove useless REG_EH_REGION from real_insn, while
    with -g0 it will not.

    Yet another option would be not skipping NOTE_P in the loop; I couldn't
find
    in history rationale for why it is done.

    2020-05-13  Jakub Jelinek  <jakub@redhat.com>

            PR debug/95080
            * cfgrtl.c (purge_dead_edges): Skip over debug and note insns even
            if the last insn is a note.

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

    (cherry picked from commit 18edc195442291525e04f0fa4d5ef972155117da)

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

* [Bug debug/95080] [10 Regression] -fcompare-debug failure (length) with -Og -fcse-follow-jumps -fnon-call-exceptions
  2020-05-12 11:17 [Bug debug/95080] New: [10/11 Regression] -fcompare-debug failure (length) with -Og -fcse-follow-jumps -fnon-call-exceptions zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2020-06-14 10:07 ` cvs-commit at gcc dot gnu.org
@ 2020-06-14 11:46 ` jakub at gcc dot gnu.org
  2020-09-16 19:22 ` cvs-commit at gcc dot gnu.org
  2020-09-17 17:50 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-06-14 11:46 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

* [Bug debug/95080] [10 Regression] -fcompare-debug failure (length) with -Og -fcse-follow-jumps -fnon-call-exceptions
  2020-05-12 11:17 [Bug debug/95080] New: [10/11 Regression] -fcompare-debug failure (length) with -Og -fcse-follow-jumps -fnon-call-exceptions zsojka at seznam dot cz
                   ` (6 preceding siblings ...)
  2020-06-14 11:46 ` jakub at gcc dot gnu.org
@ 2020-09-16 19:22 ` cvs-commit at gcc dot gnu.org
  2020-09-17 17:50 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-09-16 19:22 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:9d01f91514f627590adc408ac9a35a7153123119

commit r9-8898-g9d01f91514f627590adc408ac9a35a7153123119
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed May 13 11:22:37 2020 +0200

    Fix -fcompare-debug issue in purge_dead_edges [PR95080]

    The following testcase fails with -fcompare-debug, the bug used to be
latent
    since introduction of -fcompare-debug.
    The loop at the start of purge_dead_edges behaves differently between -g0
    and -g - if the last insn is a DEBUG_INSN, then it skips not just
    DEBUG_INSNs but also NOTEs until it finds some other real insn (or bb
head),
    while with -g0 it will not skip any NOTEs, so if we have
    real_insn
    note
    debug_insn // not present with -g0
    then with -g it might remove useless REG_EH_REGION from real_insn, while
    with -g0 it will not.

    Yet another option would be not skipping NOTE_P in the loop; I couldn't
find
    in history rationale for why it is done.

    2020-05-13  Jakub Jelinek  <jakub@redhat.com>

            PR debug/95080
            * cfgrtl.c (purge_dead_edges): Skip over debug and note insns even
            if the last insn is a note.

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

    (cherry picked from commit 18edc195442291525e04f0fa4d5ef972155117da)

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

* [Bug debug/95080] [10 Regression] -fcompare-debug failure (length) with -Og -fcse-follow-jumps -fnon-call-exceptions
  2020-05-12 11:17 [Bug debug/95080] New: [10/11 Regression] -fcompare-debug failure (length) with -Og -fcse-follow-jumps -fnon-call-exceptions zsojka at seznam dot cz
                   ` (7 preceding siblings ...)
  2020-09-16 19:22 ` cvs-commit at gcc dot gnu.org
@ 2020-09-17 17:50 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-09-17 17:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
For 8.5 fixed in r8-10504-g819a383e5952dad6613791adba16c44d81da749b.

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

end of thread, other threads:[~2020-09-17 17:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-12 11:17 [Bug debug/95080] New: [10/11 Regression] -fcompare-debug failure (length) with -Og -fcse-follow-jumps -fnon-call-exceptions zsojka at seznam dot cz
2020-05-12 11:24 ` [Bug debug/95080] " rguenth at gcc dot gnu.org
2020-05-12 16:47 ` jakub at gcc dot gnu.org
2020-05-12 19:07 ` jakub at gcc dot gnu.org
2020-05-13  9:23 ` cvs-commit at gcc dot gnu.org
2020-05-13  9:24 ` [Bug debug/95080] [10 " jakub at gcc dot gnu.org
2020-06-14 10:07 ` cvs-commit at gcc dot gnu.org
2020-06-14 11:46 ` jakub at gcc dot gnu.org
2020-09-16 19:22 ` cvs-commit at gcc dot gnu.org
2020-09-17 17:50 ` 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).