public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/109505] (t | 15) & svcntb() causes an OOM/ICE
Date: Mon, 22 May 2023 13:52:27 +0000	[thread overview]
Message-ID: <bug-109505-4-lefrNZtgEr@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-109505-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #20 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:0feece18e6993d02f24a9381ddb5420bb4509554

commit r13-7365-g0feece18e6993d02f24a9381ddb5420bb4509554
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Sun May 21 13:36:56 2023 +0200

    atch.pd: Ensure (op CONSTANT_CLASS_P CONSTANT_CLASS_P) is simplified
[PR109505]

    On the following testcase we hang, because POLY_INT_CST is
CONSTANT_CLASS_P,
    but BIT_AND_EXPR with it and INTEGER_CST doesn't simplify and the
    (x | CST1) & CST2 -> (x & CST2) | (CST1 & CST2)
    simplification actually relies on the (CST1 & CST2) simplification,
    otherwise it is a deoptimization, trading 2 ops for 3 and furthermore
    running into
    /* Given a bit-wise operation CODE applied to ARG0 and ARG1, see if both
       operands are another bit-wise operation with a common input.  If so,
       distribute the bit operations to save an operation and possibly two if
       constants are involved.  For example, convert
         (A | B) & (A | C) into A | (B & C)
       Further simplification will occur if B and C are constants.  */
    simplification which simplifies that
    (x & CST2) | (CST1 & CST2) back to
    CST2 & (x | CST1).
    I went through all other places I could find where we have a simplification
    with 2 CONSTANT_CLASS_P operands and perform some operation on those two,
    while the other spots aren't that severe (just trade 2 operations for
    another 2 if the two constants don't simplify, rather than as in the above
    case trading 2 ops for 3), I still think all those spots really intend
    to optimize only if the 2 constants simplify.

    So, the following patch adds to those a ! modifier to ensure that,
    even at GENERIC that modifier means !EXPR_P which is exactly what we want
    IMHO.

    2023-05-21  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/109505
            * match.pd ((x | CST1) & CST2 -> (x & CST2) | (CST1 & CST2),
            Combine successive equal operations with constants,
            (A +- CST1) +- CST2 -> A + CST3, (CST1 - A) +- CST2 -> CST3 - A,
            CST1 - (CST2 - A) -> CST3 + A): Use ! on ops with 2
CONSTANT_CLASS_P
            operands.

            * gcc.target/aarch64/sve/pr109505.c: New test.

    (cherry picked from commit f211757f6fa9515e3fd1a4f66f1a8b48e500c9de)

  parent reply	other threads:[~2023-05-22 13:52 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-13 19:21 [Bug c++/109505] New: Compiler loops forever to OOM while compiling evaluate_prg_hwy.cc in Chromium jdapena at igalia dot com
2023-04-13 20:49 ` [Bug c++/109505] " pinskia at gcc dot gnu.org
2023-04-14  8:21 ` jdapena at igalia dot com
2023-04-14  8:23 ` jdapena at igalia dot com
2023-04-14 21:38 ` pinskia at gcc dot gnu.org
2023-04-14 21:53 ` [Bug c++/109505] [12/13 Regression] " pinskia at gcc dot gnu.org
2023-04-14 22:33 ` pinskia at gcc dot gnu.org
2023-04-14 22:40 ` [Bug c++/109505] [12/13 Regression] Compiler loops forever to OOM while compiling evaluate_prg_hwy.cc and SVE pinskia at gcc dot gnu.org
2023-04-14 22:52 ` [Bug middle-end/109505] (t | 15) & svcntb() causes an OOM/ICE pinskia at gcc dot gnu.org
2023-04-16  0:38 ` pinskia at gcc dot gnu.org
2023-04-17  7:03 ` rguenth at gcc dot gnu.org
2023-04-17  7:16 ` rsandifo at gcc dot gnu.org
2023-04-17  7:25 ` pinskia at gcc dot gnu.org
2023-04-17  7:39 ` rsandifo at gcc dot gnu.org
2023-04-17  8:01 ` jakub at gcc dot gnu.org
2023-04-17  8:05 ` rguenther at suse dot de
2023-04-17  8:07 ` rsandifo at gcc dot gnu.org
2023-05-09 23:47 ` pinskia at gcc dot gnu.org
2023-05-20  7:27 ` sjames at gcc dot gnu.org
2023-05-20  8:15 ` jakub at gcc dot gnu.org
2023-05-21 11:37 ` cvs-commit at gcc dot gnu.org
2023-05-22 13:52 ` cvs-commit at gcc dot gnu.org [this message]
2023-05-22 14:09 ` cvs-commit at gcc dot gnu.org
2023-05-22 14:11 ` jakub at gcc dot gnu.org
2023-06-01  8:57 ` herrtimson at yahoo dot de
2023-06-01 10:13 ` jakub at gcc dot gnu.org
2023-06-02  6:56 ` rguenth at gcc dot gnu.org
2023-06-02  7:46 ` cvs-commit at gcc dot gnu.org
2023-06-02  7:46 ` cvs-commit at gcc dot gnu.org
2023-06-02  7:47 ` 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-109505-4-lefrNZtgEr@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).