public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "aldyh at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/103388] [12 Regression] missed optimization for dead code elimination at -O3 (vs. -O2)
Date: Tue, 23 Nov 2021 19:31:03 +0000	[thread overview]
Message-ID: <bug-103388-4-U5lH7bl7FO@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103388-4@http.gcc.gnu.org/bugzilla/>

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

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at gcc dot gnu.org
         Resolution|DUPLICATE                   |---
             Status|RESOLVED                    |NEW
   Last reconfirmed|                            |2021-11-23
     Ever confirmed|0                           |1

--- Comment #2 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
(In reply to Aldy Hernandez from comment #1)
> By *.threadfull1 this is the path at 4->5->7.  It looks like:
> 
> PREHEADER
> |
> v
> HEADER--------+
> |             |
> V
> UNREACHABLE   |
> |            /
> V           /
> return 0 <-+
> 
> This is more or less PR102981.
> 
> Is there any way we can stop reporting the same thing over and over?
> 
> *** This bug has been marked as a duplicate of bug 102981 ***

Errr, wait a minute, that's not a loop.  My bad.

We're failing to thread 4->5->xxx because:

Checking profitability of path (backwards):  bb:5 (10 insns) bb:4
  Control statement insns: 2
  Overall: 8 insns
  FAIL: Did not thread around loop and would copy too many statements.

which is a limitation of the backward threader copier:

  /* The generic copier used by the backthreader does not re-use an
     existing threading path to reduce code duplication.  So for that
     case, drastically reduce the number of statements we are allowed
     to copy.  */
  if (!(threaded_through_latch && threaded_multiway_branch)
      && (n_insns * param_fsm_scale_path_stmts
          >= param_max_jump_thread_duplication_stmts))
    {
      if (dump_file && (dump_flags & TDF_DETAILS))
        fprintf (dump_file,
                 "  FAIL: Did not thread around loop and would copy too "
                 "many statements.\n");
      return false;
    }

Confirmed.

  parent reply	other threads:[~2021-11-23 19:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23 18:21 [Bug tree-optimization/103388] New: " theodort at inf dot ethz.ch
2021-11-23 19:19 ` [Bug tree-optimization/103388] " aldyh at gcc dot gnu.org
2021-11-23 19:31 ` aldyh at gcc dot gnu.org [this message]
2021-11-23 23:18 ` law at gcc dot gnu.org
2021-11-24  8:50 ` [Bug tree-optimization/103388] [12 Regression] missed optimization for dead code elimination at -O3 (trunk vs 11.2.0) rguenth at gcc dot gnu.org
2022-01-18 14:24 ` rguenth at gcc dot gnu.org
2022-01-18 15:28 ` law at gcc dot gnu.org
2022-05-06  8:31 ` [Bug tree-optimization/103388] [12/13 " jakub at gcc dot gnu.org
2022-07-26 13:09 ` rguenth at gcc dot gnu.org
2023-05-08 12:23 ` [Bug tree-optimization/103388] [12/13/14 " rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-103388-4-U5lH7bl7FO@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).