public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/102764] New: -fcompare-debug failure (length) at -O3
@ 2021-10-15  6:04 cnsun at uwaterloo dot ca
  2021-10-15  6:58 ` [Bug middle-end/102764] " rguenth at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: cnsun at uwaterloo dot ca @ 2021-10-15  6:04 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102764
           Summary: -fcompare-debug failure (length) at -O3
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cnsun at uwaterloo dot ca
  Target Milestone: ---

(Really do not know what is the best summary for this bug.)

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/scratch/software/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /tmp/tmp.gzh6IUhxke-gcc-builder/gcc/configure
--enable-languages=c,c++,lto --enable-checking-yes --enable-multiarch
--prefix=/scratch/software/gcc-trunk --disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20211014 (experimental) [master -gee9fa8a57] (GCC)

$ cat mutant.c
volatile a;
main() {
  int i;
  for (i = 0; i < 1000; i++)
    if (i % 17)
      a++;
}

$ gcc-trunk -w -fcompare-debug -O3 mutant.c
gcc-trunk: error: mutant.c: ‘-fcompare-debug’ failure (length)

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

* [Bug middle-end/102764] -fcompare-debug failure (length) at -O3
  2021-10-15  6:04 [Bug c/102764] New: -fcompare-debug failure (length) at -O3 cnsun at uwaterloo dot ca
@ 2021-10-15  6:58 ` rguenth at gcc dot gnu.org
  2021-10-15  7:04 ` pinskia at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-10-15  6:58 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-10-15
            Version|unknown                     |12.0
          Component|c                           |middle-end
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Already happens at -O2 for me btw, confirmed.  GIMPLE is the same but also the
assembly, so not exactly sure what -fcompare-debug complains about.

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

* [Bug middle-end/102764] -fcompare-debug failure (length) at -O3
  2021-10-15  6:04 [Bug c/102764] New: -fcompare-debug failure (length) at -O3 cnsun at uwaterloo dot ca
  2021-10-15  6:58 ` [Bug middle-end/102764] " rguenth at gcc dot gnu.org
@ 2021-10-15  7:04 ` pinskia at gcc dot gnu.org
  2021-10-15  8:28 ` [Bug middle-end/102764] [12 Regression] -fcompare-debug failure (length) at -O3 since r12-630-g7c4c9fcc0de86587 marxin at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-10-15  7:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
It might be complaining because the linw info (columns) are different between
the two.
I have seen that before.

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

* [Bug middle-end/102764] [12 Regression] -fcompare-debug failure (length) at -O3 since r12-630-g7c4c9fcc0de86587
  2021-10-15  6:04 [Bug c/102764] New: -fcompare-debug failure (length) at -O3 cnsun at uwaterloo dot ca
  2021-10-15  6:58 ` [Bug middle-end/102764] " rguenth at gcc dot gnu.org
  2021-10-15  7:04 ` pinskia at gcc dot gnu.org
@ 2021-10-15  8:28 ` marxin at gcc dot gnu.org
  2021-10-15  8:45 ` ebotcazou at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-10-15  8:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
   Target Milestone|---                         |12.0
            Summary|-fcompare-debug failure     |[12 Regression]
                   |(length) at -O3             |-fcompare-debug failure
                   |                            |(length) at -O3 since
                   |                            |r12-630-g7c4c9fcc0de86587

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r12-630-g7c4c9fcc0de86587.

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

* [Bug middle-end/102764] [12 Regression] -fcompare-debug failure (length) at -O3 since r12-630-g7c4c9fcc0de86587
  2021-10-15  6:04 [Bug c/102764] New: -fcompare-debug failure (length) at -O3 cnsun at uwaterloo dot ca
                   ` (2 preceding siblings ...)
  2021-10-15  8:28 ` [Bug middle-end/102764] [12 Regression] -fcompare-debug failure (length) at -O3 since r12-630-g7c4c9fcc0de86587 marxin at gcc dot gnu.org
@ 2021-10-15  8:45 ` ebotcazou at gcc dot gnu.org
  2021-10-20  8:26 ` [Bug middle-end/102764] [12 Regression] -fcompare-debug failure (length) at -O3 ebotcazou at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2021-10-15  8:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
This seems to work:

diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 03260b019e5..8b067f9d848 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -6090,7 +6090,7 @@ expand_gimple_basic_block (basic_block bb, bool
disable_tail_calls)
   /* Expand implicit goto and convert goto_locus.  */
   FOR_EACH_EDGE (e, ei, bb->succs)
     {
-      if (e->goto_locus != UNKNOWN_LOCATION || !stmt)
+      if (e->goto_locus != UNKNOWN_LOCATION || !stmt || is_gimple_debug
(stmt))
        set_curr_insn_location (e->goto_locus);
       if ((e->flags & EDGE_FALLTHRU) && e->dest != bb->next_bb)
        {

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

* [Bug middle-end/102764] [12 Regression] -fcompare-debug failure (length) at -O3
  2021-10-15  6:04 [Bug c/102764] New: -fcompare-debug failure (length) at -O3 cnsun at uwaterloo dot ca
                   ` (3 preceding siblings ...)
  2021-10-15  8:45 ` ebotcazou at gcc dot gnu.org
@ 2021-10-20  8:26 ` ebotcazou at gcc dot gnu.org
  2021-10-20  8:47 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2021-10-20  8:26 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |ebotcazou at gcc dot gnu.org
            Summary|[12 Regression]             |[12 Regression]
                   |-fcompare-debug failure     |-fcompare-debug failure
                   |(length) at -O3 since       |(length) at -O3
                   |r12-630-g7c4c9fcc0de86587   |
                 CC|ebotcazou at gcc dot gnu.org       |
             Status|NEW                         |ASSIGNED

--- Comment #5 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Fixing.

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

* [Bug middle-end/102764] [12 Regression] -fcompare-debug failure (length) at -O3
  2021-10-15  6:04 [Bug c/102764] New: -fcompare-debug failure (length) at -O3 cnsun at uwaterloo dot ca
                   ` (4 preceding siblings ...)
  2021-10-20  8:26 ` [Bug middle-end/102764] [12 Regression] -fcompare-debug failure (length) at -O3 ebotcazou at gcc dot gnu.org
@ 2021-10-20  8:47 ` cvs-commit at gcc dot gnu.org
  2021-10-20  8:49 ` ebotcazou at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-20  8:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Eric Botcazou <ebotcazou@gcc.gnu.org>:

https://gcc.gnu.org/g:972ee845f54839e9bd2e4611bb268d75440f3845

commit r12-4531-g972ee845f54839e9bd2e4611bb268d75440f3845
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Wed Oct 20 10:42:56 2021 +0200

    Fix PR middle-end/102764

    This is a regression present on the mainline in the form of -fcompare-debug
    failure at -O3 on a compiler-generated testcase.  Fixed by disregarding a
    debug statement in the last position of a basic block to reset the current
    location for the outgoing edges.

    gcc/
            PR middle-end/102764
            * cfgexpand.c (expand_gimple_basic_block): Disregard a final debug
            statement to reset the current location for the outgoing edges.

    gcc/testsuite/
            * gcc.dg/pr102764.c: New test.

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

* [Bug middle-end/102764] [12 Regression] -fcompare-debug failure (length) at -O3
  2021-10-15  6:04 [Bug c/102764] New: -fcompare-debug failure (length) at -O3 cnsun at uwaterloo dot ca
                   ` (5 preceding siblings ...)
  2021-10-20  8:47 ` cvs-commit at gcc dot gnu.org
@ 2021-10-20  8:49 ` ebotcazou at gcc dot gnu.org
  2021-10-21  1:45 ` hjl.tools at gmail dot com
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2021-10-20  8:49 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

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

--- Comment #7 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
.

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

* [Bug middle-end/102764] [12 Regression] -fcompare-debug failure (length) at -O3
  2021-10-15  6:04 [Bug c/102764] New: -fcompare-debug failure (length) at -O3 cnsun at uwaterloo dot ca
                   ` (6 preceding siblings ...)
  2021-10-20  8:49 ` ebotcazou at gcc dot gnu.org
@ 2021-10-21  1:45 ` hjl.tools at gmail dot com
  2021-10-21 15:59 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2021-10-21  1:45 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

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

--- Comment #8 from H.J. Lu <hjl.tools at gmail dot com> ---
The fix caused:

FAIL: gcc.dg/asan/pr78832.c   -O1  (test for excess errors)
FAIL: gcc.dg/asan/pr78832.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  (test for excess errors)
FAIL: gcc.dg/asan/pr78832.c   -O2  (test for excess errors)
FAIL: gcc.dg/asan/pr78832.c   -O3 -g  (test for excess errors)
FAIL: gcc.dg/asan/pr78832.c   -Os  (test for excess errors)
FAIL: gcc.dg/pr45055.c (test for excess errors)
FAIL: gcc.dg/pr45105.c (test for excess errors)
FAIL: gcc.dg/pr45865.c (test for excess errors)
FAIL: gcc.dg/torture/pr48343.c   -O1  (test for excess errors)
FAIL: gcc.dg/torture/pr48343.c   -Os  (test for excess errors)
FAIL: gcc.target/i386/pr57106.c (test for excess errors)

with GCC configured with

../../gcc/configure
--prefix=/local/skpandey/gccwork/toolwork/gcc-bisect-master/master/r12-4531/usr
--enable-clocale=gnu --with-system-zlib --with-demangler-in-ld
--with-fpmath=sse --enable-languages=c,c++,fortran --enable-cet --without-isl
--enable-libmpx x86_64-linux --disable-bootstrap

To reproduce:

$ cd {build_dir}/gcc && make check RUNTESTFLAGS="asan.exp=gcc.dg/asan/pr78832.c
--target_board='unix{-m32}'"
$ cd {build_dir}/gcc && make check RUNTESTFLAGS="asan.exp=gcc.dg/asan/pr78832.c
--target_board='unix{-m32\ -march=cascadelake}'"
$ cd {build_dir}/gcc && make check RUNTESTFLAGS="dg.exp=gcc.dg/pr45055.c
--target_board='unix{-m32}'"
$ cd {build_dir}/gcc && make check RUNTESTFLAGS="dg.exp=gcc.dg/pr45055.c
--target_board='unix{-m32\ -march=cascadelake}'"
$ cd {build_dir}/gcc && make check RUNTESTFLAGS="dg.exp=gcc.dg/pr45105.c
--target_board='unix{-m32}'"
$ cd {build_dir}/gcc && make check RUNTESTFLAGS="dg.exp=gcc.dg/pr45105.c
--target_board='unix{-m32\ -march=cascadelake}'"
$ cd {build_dir}/gcc && make check RUNTESTFLAGS="dg.exp=gcc.dg/pr45865.c
--target_board='unix{-m32}'"
$ cd {build_dir}/gcc && make check RUNTESTFLAGS="dg.exp=gcc.dg/pr45865.c
--target_board='unix{-m32\ -march=cascadelake}'"
$ cd {build_dir}/gcc && make check
RUNTESTFLAGS="dg-torture.exp=gcc.dg/torture/pr48343.c
--target_board='unix{-m32}'"
$ cd {build_dir}/gcc && make check
RUNTESTFLAGS="dg-torture.exp=gcc.dg/torture/pr48343.c
--target_board='unix{-m32\ -march=cascadelake}'"
$ cd {build_dir}/gcc && make check
RUNTESTFLAGS="i386.exp=gcc.target/i386/pr57106.c --target_board='unix{-m32}'"
$ cd {build_dir}/gcc && make check
RUNTESTFLAGS="i386.exp=gcc.target/i386/pr57106.c --target_board='unix{-m32\
-march=cascadelake}'"

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

* [Bug middle-end/102764] [12 Regression] -fcompare-debug failure (length) at -O3
  2021-10-15  6:04 [Bug c/102764] New: -fcompare-debug failure (length) at -O3 cnsun at uwaterloo dot ca
                   ` (7 preceding siblings ...)
  2021-10-21  1:45 ` hjl.tools at gmail dot com
@ 2021-10-21 15:59 ` cvs-commit at gcc dot gnu.org
  2021-10-21 16:02 ` ebotcazou at gcc dot gnu.org
  2022-03-01 15:43 ` jakub at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-21 15:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Eric Botcazou <ebotcazou@gcc.gnu.org>:

https://gcc.gnu.org/g:9262ae450d6a57837c58645c2ee66365bbe08338

commit r12-4616-g9262ae450d6a57837c58645c2ee66365bbe08338
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Thu Oct 21 17:57:55 2021 +0200

    Fix again PR middle-end/102764

    gcc/
            PR middle-end/102764
            * cfgexpand.c (expand_gimple_basic_block): Robustify latest change.

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

* [Bug middle-end/102764] [12 Regression] -fcompare-debug failure (length) at -O3
  2021-10-15  6:04 [Bug c/102764] New: -fcompare-debug failure (length) at -O3 cnsun at uwaterloo dot ca
                   ` (8 preceding siblings ...)
  2021-10-21 15:59 ` cvs-commit at gcc dot gnu.org
@ 2021-10-21 16:02 ` ebotcazou at gcc dot gnu.org
  2022-03-01 15:43 ` jakub at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2021-10-21 16:02 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

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

--- Comment #10 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
.

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

* [Bug middle-end/102764] [12 Regression] -fcompare-debug failure (length) at -O3
  2021-10-15  6:04 [Bug c/102764] New: -fcompare-debug failure (length) at -O3 cnsun at uwaterloo dot ca
                   ` (9 preceding siblings ...)
  2021-10-21 16:02 ` ebotcazou at gcc dot gnu.org
@ 2022-03-01 15:43 ` jakub at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-03-01 15:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |zsojka at seznam dot cz

--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
*** Bug 100541 has been marked as a duplicate of this bug. ***

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

end of thread, other threads:[~2022-03-01 15:43 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-15  6:04 [Bug c/102764] New: -fcompare-debug failure (length) at -O3 cnsun at uwaterloo dot ca
2021-10-15  6:58 ` [Bug middle-end/102764] " rguenth at gcc dot gnu.org
2021-10-15  7:04 ` pinskia at gcc dot gnu.org
2021-10-15  8:28 ` [Bug middle-end/102764] [12 Regression] -fcompare-debug failure (length) at -O3 since r12-630-g7c4c9fcc0de86587 marxin at gcc dot gnu.org
2021-10-15  8:45 ` ebotcazou at gcc dot gnu.org
2021-10-20  8:26 ` [Bug middle-end/102764] [12 Regression] -fcompare-debug failure (length) at -O3 ebotcazou at gcc dot gnu.org
2021-10-20  8:47 ` cvs-commit at gcc dot gnu.org
2021-10-20  8:49 ` ebotcazou at gcc dot gnu.org
2021-10-21  1:45 ` hjl.tools at gmail dot com
2021-10-21 15:59 ` cvs-commit at gcc dot gnu.org
2021-10-21 16:02 ` ebotcazou at gcc dot gnu.org
2022-03-01 15:43 ` 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).