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.

Reply via email to