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 target/108832] [13 Regression] ICE in replace_rtx, at rtlanal.cc:3358
Date: Sat, 18 Feb 2023 11:41:19 +0000	[thread overview]
Message-ID: <bug-108832-4-34XgEAZ72G@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108832-4@http.gcc.gnu.org/bugzilla/>

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

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

https://gcc.gnu.org/g:3c135697fd5f79db0954a79a48dcbba657e93f2e

commit r13-6131-g3c135697fd5f79db0954a79a48dcbba657e93f2e
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Sat Feb 18 12:40:04 2023 +0100

    i386: Fix up replacement of registers in certain peephole2s [PR108832]

    As mentioned in the PR, replace_rtx has 2 modes, one that only replaces
    x == from with to, the other which i386.md uses which also replaces
    REGNO (x) == REGNO (from) with to if both are REGs, but assert they have
    the same mode.  This is reasonable behavior if one replaces from with
    some other expression, say constant etc., but ICEs whenever the register
    appears in a different mode, which happens e.g. on the following testcase,
    where from/to has DImode but inside of the operands we have SImode of
    the from register.  replace_rtx also does some limited simplifications
    (though far less than simplify_replace_fn_rtx), which is needed if
    from a REG is replaced say with CONST_INT, but the peephole2s that use
    this only replace one REG with another one.

    The following patch introduces a new backend function for this, avoids
doing
    any simplifications and just replaces the REGs, for safety on a copy of
    the expression if any changes will be needed.

    2023-02-18  Jakub Jelinek  <jakub@redhat.com>

            PR target/108832
            * config/i386/i386-protos.h (ix86_replace_reg_with_reg): Declare.
            * config/i386/i386-expand.cc (ix86_replace_reg_with_reg): New
            function.
            * config/i386/i386.md: Replace replace_rtx calls in all peephole2s
            with ix86_replace_reg_with_reg.

            * gcc.target/i386/pr108832.c: New test.

  parent reply	other threads:[~2023-02-18 11:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-17 10:28 [Bug target/108832] New: " asolokha at gmx dot com
2023-02-17 11:40 ` [Bug target/108832] " jakub at gcc dot gnu.org
2023-02-17 11:51 ` rguenth at gcc dot gnu.org
2023-02-17 11:57 ` jakub at gcc dot gnu.org
2023-02-17 13:16 ` ubizjak at gmail dot com
2023-02-17 13:21 ` jakub at gcc dot gnu.org
2023-02-17 13:45 ` jakub at gcc dot gnu.org
2023-02-18 11:41 ` cvs-commit at gcc dot gnu.org [this message]
2023-02-18 11:41 ` jakub 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-108832-4-34XgEAZ72G@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).