[Bug tree-optimization/126906] back threader does not thread paths into unreachable edges but DOM does

aldy at quesejoda dot com via Gcc-bugs <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126906

--- Comment #2 from aldy at quesejoda dot com ---
   The backwards threader is finding this path but silently drops it at
   BB copy time. I think it's a limitation of the generic copier:
   can_copy_bbs_p refuses to copy a region when an abnormal edge points
   back into it, and here the computed goto's abnormal edge to lab2 lands
   inside the region being duplicated. BTW, we need a way to dump these
   dropped threads, because our current SUCCESS message is deceiving.
   I can work on the dump part at least.
   On Aug 16, 2026 19:41, "pinskia at gcc dot gnu.org"
   <[email protected]> wrote:

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

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

     What |Removed |Added
    
----------------------------------------------------------------------------
     Severity|normal |enhancement
     Last reconfirmed| |2026-08-16
     Status|UNCONFIRMED |NEW
     Ever confirmed|0 |1

     --- Comment #1 from Drea Pinski <pinskia at gcc dot gnu.org> ---
     Confirmed. But I am not sure it is unreachable which is causing
     the issue as
     non DOM threading does not handle this either:
     ```

     void
     foo (int b, int c)
     {
     void *x = &&lab;
     if (b)
     {
     lab:
     return;
     }
     lab2:
     if (c)
     x = &&lab2;
     goto *x;
     }
     ```

     --
     You are receiving this mail because:
     You reported the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.