On Tue, Nov 10, 2026 at 02:44:56PM +0000, Tamar Christina wrote:
> > -----Original Message-----
> > From: Stefan Schulze Frielinghaus <[email protected]>
> > Sent: 10 November 2026 14:42
> > To: [email protected]; Tamar Christina <[email protected]>
> > Cc: Stefan Schulze Frielinghaus <[email protected]>
> > Subject: [PATCH] final: Fix test_output_operand_modifier_operand
> >
> > From: Stefan Schulze Frielinghaus <[email protected]>
> >
> > For big-endian targets offset 0 for a subreg with outer QI mode and
> > inner HI mode is invalid and leads to an ICE. Fixed by utilizing
> > gen_lowpart_SUBREG which takes care of computing the correct offset
> > which is for this particular case 1 for big-endian targets and 0 for
> > little-endian targets.
> >
> > gcc/ChangeLog:
> >
> > * final.cc (test_output_operand_modifier_operand): Replace
> > gen_rtx_SUBREG by gen_lowpart_SUBREG.
> > ---
> > Bootstrap is restored on s390 and still successful on x86_64 as before.
> > Probably counts as obvious, however, I've never touched selftests before
> > and it seems to me that it is fine to call into gen_lowpart_SUBREG here.
> > Ok for mainline?
> >
>
> I think this counts as an obvious commit :)
>
> So I'd just push it (I can't approve as not a maintainer of this area)
Agreed. So I have used my super powers at least one time today and
pushed this as obvious in r17-6124 ;)
Cheers,
Stefan
>
> Thanks,
> Tamar
>
> > gcc/final.cc | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/gcc/final.cc b/gcc/final.cc
> > index d20e0caa351..224f0835a26 100644
> > --- a/gcc/final.cc
> > +++ b/gcc/final.cc
> > @@ -4795,7 +4795,7 @@ static void
> > test_output_operand_modifier_operand ()
> > {
> > rtx operands[] = { GEN_INT (10),
> > - gen_rtx_SUBREG (QImode, gen_rtx_REG (HImode, 0), 0) };
> > + gen_lowpart_SUBREG (QImode, gen_rtx_REG (HImode, 0))
> > };
> > auto_vec<unsigned long, 2> opnums;
> > opnums.safe_push (1);
> > opnums.safe_push (0);
> > --
> > 2.55.0
>