On Fri, Feb 17, 2023 at 12:31 PM Richard Biener <rguent...@suse.de> wrote:
>
> On Fri, 17 Feb 2023, Uros Bizjak wrote:
>
> > On Fri, Feb 17, 2023 at 8:38 AM Richard Biener <rguent...@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  <ubiz...@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.

Reply via email to