public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/103838] New: [11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 --param max-early-inliner-iterations=0 --param max-inline-insns-auto=2
@ 2021-12-26 17:12 asolokha at gmx dot com
  2021-12-26 21:09 ` [Bug debug/103838] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: asolokha at gmx dot com @ 2021-12-26 17:12 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103838
           Summary: [11/12 Regression] '-fcompare-debug' failure (length)
                    w/ -O2 --param max-early-inliner-iterations=0 --param
                    max-inline-insns-auto=2
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---
            Target: x86_64-unknown-linux-gnu

Created attachment 52063
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52063&action=edit
diff -u uarspwmr.*.gkd

gcc 12.0.0 20211219 snapshot (g:fcbf94a5be9e0c1ecad92da773a6632b86b7f70a) fails
-fcompare-debug check when compiling the following testcase w/ -O2 --param
max-early-inliner-iterations=0 --param max-inline-insns-auto=2:

__int128 m;
int n;

void
bar (void)
{
  n += !!m;
}

void
foo (void)
{
  int i;

  for (i = 0; i < 2; ++i)
    {
      bar ();
      m /= 3;
    }
}

% x86_64-unknown-linux-gnu-gcc-12.0.0 -O2 -fcompare-debug --param
max-early-inliner-iterations=0 --param max-inline-insns-auto=2 -c uarspwmr.c
x86_64-unknown-linux-gnu-gcc-12.0.0: error: uarspwmr.c: '-fcompare-debug'
failure (length)

Diff between two gkd files attached.

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

* [Bug debug/103838] [11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 --param max-early-inliner-iterations=0 --param max-inline-insns-auto=2
  2021-12-26 17:12 [Bug debug/103838] New: [11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 --param max-early-inliner-iterations=0 --param max-inline-insns-auto=2 asolokha at gmx dot com
@ 2021-12-26 21:09 ` pinskia at gcc dot gnu.org
  2021-12-27  9:34 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-26 21:09 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code,
                   |                            |needs-bisection
   Target Milestone|---                         |11.3

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

* [Bug debug/103838] [11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 --param max-early-inliner-iterations=0 --param max-inline-insns-auto=2
  2021-12-26 17:12 [Bug debug/103838] New: [11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 --param max-early-inliner-iterations=0 --param max-inline-insns-auto=2 asolokha at gmx dot com
  2021-12-26 21:09 ` [Bug debug/103838] " pinskia at gcc dot gnu.org
@ 2021-12-27  9:34 ` jakub at gcc dot gnu.org
  2021-12-27 10:00 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-12-27  9:34 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
           Priority|P3                          |P2
                 CC|                            |jakub at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-12-27
           Keywords|needs-bisection             |

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with my r11-5648-g037fe26ee1ac18581bf0ad646d48591c97d10bd3

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

* [Bug debug/103838] [11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 --param max-early-inliner-iterations=0 --param max-inline-insns-auto=2
  2021-12-26 17:12 [Bug debug/103838] New: [11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 --param max-early-inliner-iterations=0 --param max-inline-insns-auto=2 asolokha at gmx dot com
  2021-12-26 21:09 ` [Bug debug/103838] " pinskia at gcc dot gnu.org
  2021-12-27  9:34 ` jakub at gcc dot gnu.org
@ 2021-12-27 10:00 ` jakub at gcc dot gnu.org
  2021-12-27 10:12 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-12-27 10:00 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug debug/103838] [11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 --param max-early-inliner-iterations=0 --param max-inline-insns-auto=2
  2021-12-26 17:12 [Bug debug/103838] New: [11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 --param max-early-inliner-iterations=0 --param max-inline-insns-auto=2 asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2021-12-27 10:00 ` jakub at gcc dot gnu.org
@ 2021-12-27 10:12 ` jakub at gcc dot gnu.org
  2021-12-28 16:39 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-12-27 10:12 UTC (permalink / raw)
  To: gcc-bugs

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

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

Untested fix.

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

* [Bug debug/103838] [11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 --param max-early-inliner-iterations=0 --param max-inline-insns-auto=2
  2021-12-26 17:12 [Bug debug/103838] New: [11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 --param max-early-inliner-iterations=0 --param max-inline-insns-auto=2 asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2021-12-27 10:12 ` jakub at gcc dot gnu.org
@ 2021-12-28 16:39 ` cvs-commit at gcc dot gnu.org
  2021-12-28 16:42 ` [Bug debug/103838] [11 " jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-12-28 16:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:78ee8381bf0ebd09a92936bdb9e1b5c9fc85ad88

commit r12-6133-g78ee8381bf0ebd09a92936bdb9e1b5c9fc85ad88
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Dec 28 17:39:23 2021 +0100

    optabs: Fix up checking for CALLs in newly added code by double-word divmod
[PR103838]

    These two spots are meant to punt if the newly added code contains
    any CALL_INSNs, because in that case having a large sequence of insns
    that also calls something is undesirable, better have one call that
    is optimized in itself well.
    The functions do last = get_last_insn (); before emitting any insns
    (and expand_binop as the ultimate caller uses delete_insns_since if
    the expansion fails), but the checks were incorrect for 2 reasons:
    1) it checked not just what follows after that last insn, but also
       the last insn itself; so, if the division or modulo is immediately
       preceded by a CALL_INSN, then we punt; this also causes -fcompare-debug
       failures if the CALL_INSN is with -g followed by one or more DEBUG_INSNs
    2) if get_last_insn () is NULL (i.e. emitting into a new sequence), then
       we didn't check anything

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

            PR debug/103838
            * optabs.c (expand_doubleword_mod, expand_doubleword_divmod): Only
            check newly added insns for CALL_P, not the last insn of previous
            code.

            * gcc.dg/pr103838.c: New test.

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

* [Bug debug/103838] [11 Regression] '-fcompare-debug' failure (length) w/ -O2 --param max-early-inliner-iterations=0 --param max-inline-insns-auto=2
  2021-12-26 17:12 [Bug debug/103838] New: [11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 --param max-early-inliner-iterations=0 --param max-inline-insns-auto=2 asolokha at gmx dot com
                   ` (4 preceding siblings ...)
  2021-12-28 16:39 ` cvs-commit at gcc dot gnu.org
@ 2021-12-28 16:42 ` jakub at gcc dot gnu.org
  2022-01-24  9:20 ` cvs-commit at gcc dot gnu.org
  2022-01-24  9:30 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-12-28 16:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[11/12 Regression]          |[11 Regression]
                   |'-fcompare-debug' failure   |'-fcompare-debug' failure
                   |(length) w/ -O2 --param     |(length) w/ -O2 --param
                   |max-early-inliner-iteration |max-early-inliner-iteration
                   |s=0 --param                 |s=0 --param
                   |max-inline-insns-auto=2     |max-inline-insns-auto=2

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk so far.

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

* [Bug debug/103838] [11 Regression] '-fcompare-debug' failure (length) w/ -O2 --param max-early-inliner-iterations=0 --param max-inline-insns-auto=2
  2021-12-26 17:12 [Bug debug/103838] New: [11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 --param max-early-inliner-iterations=0 --param max-inline-insns-auto=2 asolokha at gmx dot com
                   ` (5 preceding siblings ...)
  2021-12-28 16:42 ` [Bug debug/103838] [11 " jakub at gcc dot gnu.org
@ 2022-01-24  9:20 ` cvs-commit at gcc dot gnu.org
  2022-01-24  9:30 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-24  9:20 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:2712f1249e0a8dd663a02bdf710a455fe5b14e3f

commit r11-9491-g2712f1249e0a8dd663a02bdf710a455fe5b14e3f
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Dec 28 17:39:23 2021 +0100

    optabs: Fix up checking for CALLs in newly added code by double-word divmod
[PR103838]

    These two spots are meant to punt if the newly added code contains
    any CALL_INSNs, because in that case having a large sequence of insns
    that also calls something is undesirable, better have one call that
    is optimized in itself well.
    The functions do last = get_last_insn (); before emitting any insns
    (and expand_binop as the ultimate caller uses delete_insns_since if
    the expansion fails), but the checks were incorrect for 2 reasons:
    1) it checked not just what follows after that last insn, but also
       the last insn itself; so, if the division or modulo is immediately
       preceded by a CALL_INSN, then we punt; this also causes -fcompare-debug
       failures if the CALL_INSN is with -g followed by one or more DEBUG_INSNs
    2) if get_last_insn () is NULL (i.e. emitting into a new sequence), then
       we didn't check anything

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

            PR debug/103838
            * optabs.c (expand_doubleword_mod, expand_doubleword_divmod): Only
            check newly added insns for CALL_P, not the last insn of previous
            code.

            * gcc.dg/pr103838.c: New test.

    (cherry picked from commit 78ee8381bf0ebd09a92936bdb9e1b5c9fc85ad88)

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

* [Bug debug/103838] [11 Regression] '-fcompare-debug' failure (length) w/ -O2 --param max-early-inliner-iterations=0 --param max-inline-insns-auto=2
  2021-12-26 17:12 [Bug debug/103838] New: [11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 --param max-early-inliner-iterations=0 --param max-inline-insns-auto=2 asolokha at gmx dot com
                   ` (6 preceding siblings ...)
  2022-01-24  9:20 ` cvs-commit at gcc dot gnu.org
@ 2022-01-24  9:30 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-01-24  9:30 UTC (permalink / raw)
  To: gcc-bugs

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

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 for 11.3 too.

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

end of thread, other threads:[~2022-01-24  9:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-26 17:12 [Bug debug/103838] New: [11/12 Regression] '-fcompare-debug' failure (length) w/ -O2 --param max-early-inliner-iterations=0 --param max-inline-insns-auto=2 asolokha at gmx dot com
2021-12-26 21:09 ` [Bug debug/103838] " pinskia at gcc dot gnu.org
2021-12-27  9:34 ` jakub at gcc dot gnu.org
2021-12-27 10:00 ` jakub at gcc dot gnu.org
2021-12-27 10:12 ` jakub at gcc dot gnu.org
2021-12-28 16:39 ` cvs-commit at gcc dot gnu.org
2021-12-28 16:42 ` [Bug debug/103838] [11 " jakub at gcc dot gnu.org
2022-01-24  9:20 ` cvs-commit at gcc dot gnu.org
2022-01-24  9:30 ` 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).