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

            Bug ID: 112468
           Summary: [14 Regression] Missed phi-opt after recent change
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: law at gcc dot gnu.org
  Target Milestone: ---

This change:

commit 3f176e1adc6bc9cc2c21222d776b51d9f43cb66b (HEAD)
Author: Tamar Christina <tamar.christ...@arm.com>
Date:   Thu Nov 9 13:59:39 2023 +0000

    middle-end: optimize fneg (fabs (x)) to copysign (x, -1) [PR109154]

    This patch transforms fneg (fabs (x)) into copysign (x, -1) which is more
    canonical and allows a target to expand this sequence efficiently.  Such
    sequences are common in scientific code working with gradients.

    There is an existing canonicalization of copysign (x, -1) to fneg (fabs
(x))
    which I remove since this is a less efficient form.  The testsuite is also
    updated in light of this.

    gcc/ChangeLog:

            PR tree-optimization/109154
            * match.pd: Add new neg+abs rule, remove inverse copysign rule.

    gcc/testsuite/ChangeLog:

            PR tree-optimization/109154
            * gcc.dg/fold-copysign-1.c: Updated.
            * gcc.dg/pr55152-2.c: Updated.
            * gcc.dg/tree-ssa/abs-4.c: Updated.
            * gcc.dg/tree-ssa/backprop-6.c: Updated.
            * gcc.dg/tree-ssa/copy-sign-2.c: Updated.
            * gcc.dg/tree-ssa/mult-abs-2.c: Updated.
            * gcc.target/aarch64/fneg-abs_1.c: New test.
            * gcc.target/aarch64/fneg-abs_2.c: New test.
            * gcc.target/aarch64/fneg-abs_3.c: New test.
            * gcc.target/aarch64/fneg-abs_4.c: New test.
            * gcc.target/aarch64/sve/fneg-abs_1.c: New test.
            * gcc.target/aarch64/sve/fneg-abs_2.c: New test.
            * gcc.target/aarch64/sve/fneg-abs_3.c: New test.
            * gcc.target/aarch64/sve/fneg-abs_4.c: New test.



Is causing a testsuite regression on moxie-elf.  This is a scan dump failure,
so you don't need a full toolchain, just a cross compiler.

moxie-sim: gcc.dg/tree-ssa/phi-opt-24.c scan-tree-dump-not phiopt2 "if"

Reply via email to