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

            Bug ID: 123111
           Summary: [16 Regression] gcc.target/sh/pr51244-9.c fails after
                    recent change
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: law at gcc dot gnu.org
  Target Milestone: ---

sh3-linux-gnu regresses on pr51244-9.c after this change:

fae0c626250563c1619cc10c6af18a0c4cae5a97 is the first bad commit
commit fae0c626250563c1619cc10c6af18a0c4cae5a97 (HEAD)
Author: Andrew Pinski <[email protected]>
Date:   Sat Dec 6 01:11:29 2025 -0800

    final_cleanup: Call make_forwarders_with_degenerate_phis [PR46555]

    This fixes a regression introduced with r16-5258-g1d8e2d51e5c5cb.
    With GCC 12+, we would not merge forwarders (with phis, vops included),
    this meant that after the last cddce, degenerate phis would stay not
    merged which allowed for better expansion. Now after my patch, the
forwarder
    block would be removed and get worse expansion. This fixes the problem
    by creating the forwarder blocks in "optimized" and no other cleanupcfg
    is called afterwards.

    Oh this also fixes the problem at -O1 which was missed because the
agressive
    version of dce was not done at -O1.

    Bootstrapped and tested on x86_64-linux-gnu.

            PR tree-optimization/46555
    gcc/ChangeLog:

            * tree-cfgcleanup.cc (execute_cleanup_cfg_post_optimizing):
            Don't set todo to include cleanupcfg; do it manually.
            Call make_forwarders_with_degenerate_phis if optimizing.

    gcc/testsuite/ChangeLog:

            * gcc.dg/tree-ssa/pr46555.c: New test.

    Signed-off-by: Andrew Pinski <[email protected]>

It's a scan-asm test, so you don't need a full toolchain.


>From looking at the testcase it's pretty clearly in my  mind a regression.  We
failed to convert a comparison where one argument was 0 into a tst insn.  I'm
inclined to believe this is a target specific issue.  Assuming further
investigation shows that to be true, then I'd fully support pushing to P4 given
it'd be an SH specific problem at that point.

Reply via email to