From: Uros Bizjak <ubizjak@gmail.com>
To: Richard Biener <rguenther@suse.de>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
Richard Sandiford <richard.sandiford@arm.com>
Subject: Re: [PATCH] simplify-rtx: Fix VOIDmode operand handling in simplify_subreg [PR108805]
Date: Fri, 17 Feb 2023 16:05:25 +0100 [thread overview]
Message-ID: <CAFULd4YsN3qu9k=8ziNptFUNix2N82Q5RoOxa5yL4PmOFmdC5w@mail.gmail.com> (raw)
In-Reply-To: <nycvar.YFH.7.77.849.2302171131330.27913@jbgna.fhfr.qr>
On Fri, Feb 17, 2023 at 12:31 PM Richard Biener <rguenther@suse.de> wrote:
>
> On Fri, 17 Feb 2023, Uros Bizjak wrote:
>
> > On Fri, Feb 17, 2023 at 8:38 AM Richard Biener <rguenther@suse.de> wrote:
> > >
> > > On Thu, 16 Feb 2023, Uros Bizjak wrote:
> > >
> > > > simplify_subreg can return VOIDmode const_int operand and will
> > > > cause ICE in simplify_gen_subreg when this operand is passed to it.
> > > >
> > > > The patch prevents VOIDmode temporary from entering simplify_gen_subreg.
> > > > We can't process const_int operand any further, since outermode
> > > > is not an integer mode here.
> > >
> > > But if it's a CONST_INT then we know it's of int_outermode, no? That is,
> > > doesn't simplify_subreg (mode, ...) always return something in 'mode'
> > > and thus we can always pass just 'mode' as third argument to the
> > > following simplify_gen_subreg call?
> >
> > You are right. I am testing the attached patch that works too.
>
> OK if that works.
Thanks, pushed with the following ChangeLog:
simplify-rtx: Fix VOIDmode operand handling in simplify_subreg [PR108805]
simplify_subreg can return VOIDmode const_int operand and will
cause ICE in simplify_gen_subreg when this operand is passed to it.
The patch uses int_outermode instead of GET_MODE of temporary as the
innermode argument of simplify_gen_subreg.
2023-02-17 Uroš Bizjak <ubizjak@gmail.com>
gcc/ChangeLog:
PR target/108805
* simplify_rtx.cc (simplify_context::simplify_subreg): Use
int_outermode instead of GET_MODE (tem) to prevent
VOIDmode from entering simplify_gen_subreg.
Uros.
gcc/testsuite/ChangeLog:
PR target/108805
* gcc.dg/pr108805.c: New test.
Uros.
next prev parent reply other threads:[~2023-02-17 15:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-16 17:39 Uros Bizjak
2023-02-17 7:38 ` Richard Biener
2023-02-17 8:51 ` Uros Bizjak
2023-02-17 11:31 ` Richard Biener
2023-02-17 15:05 ` Uros Bizjak [this message]
2023-02-27 15:46 ` Richard Sandiford
2023-03-02 10:08 ` Andre Vieira (lists)
2023-03-02 10:13 ` Richard Sandiford
2023-03-02 14:15 ` Andre Vieira (lists)
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='CAFULd4YsN3qu9k=8ziNptFUNix2N82Q5RoOxa5yL4PmOFmdC5w@mail.gmail.com' \
--to=ubizjak@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=rguenther@suse.de \
--cc=richard.sandiford@arm.com \
/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).