This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/84157] [8 Regression] [nvptx] ICE: RTL check: expected code 'reg', have 'lshiftrt'
- From: "segher at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 01 Feb 2018 09:21:49 +0000
- Subject: [Bug rtl-optimization/84157] [8 Regression] [nvptx] ICE: RTL check: expected code 'reg', have 'lshiftrt'
- Auto-submitted: auto-generated
- References: <bug-84157-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84157
--- Comment #7 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #6)
> (In reply to Segher Boessenkool from comment #5)
> > That looks good.
> that patch was by Uros though.
Yes I misread. Uros: that patch is pre-approved.
> > But maybe the REG_P check should be in the outer "if"?
> > Slightly easier and safer to exit as early as possible.
>
> I'm not familiar with this code, but AFAIU already before r257270 we can
> generate a SUBREG of an LSHIFTRT, which is incorrect RTL. And the patch does
> not fix that, it only fixes the ICE introduces in r257270.
It doesn't have to be fixed: the generated RTL is passed to recog, which
will fail it. That is what combine does with everything (it even creates
invalid RTL on purpose to abort combination attempts!)
It seems a bit neater and easier and safer to test for REG_P a bit earlier,
but the patch is fine as-is.