[PATCH] Fix lower-subreg ICE (PR target/85945)

Jeff Law law@redhat.com
Mon Jun 11 21:46:00 GMT 2018


On 05/29/2018 02:41 AM, Jakub Jelinek wrote:
> Hi!
> 
> We ICE on the following testcase, because lower-subreg sees only
> SFmode subregs of a multi-word pseudo (V4SFmode) and decides to decompose
> it.  Decomposition is done through replacing the multi-word pseudo with
> a concat of word-sized integer pseudos; unfortunately, we don't allow
> SFmode subregs of DImode inner regs (or any other mix of floating and
> integral mode where the sizes aren't the same), so we ICE later on during
> the lower-subreg pass.
> 
> The following patch punts in that case, unless the size is the same
> (i.e. allows SFmode on 32-bit word targets or DFmode on 64-bit word ones).
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux plus tested with a
> cross to s390x-linux on the testcase.  Ok for trunk?
> 
> BTW, wonder if we also shouldn't punt in case the inner mode is vector mode,
> I don't think it is desirable to undo vectorization this way (but would like
> to try that as a separate patch and gather some statistics).
> 
> For this patch I've gathered statistics too, on x86_64/i686-linux this patch
> changes behavior in a couple of 64-bit gcc.target/i386/ tests where the
> modes in all cases were SFmode (outer) and V4SFmode (inner), but it seems at
> least on avx5124fmadd-v4fnmaddss-1.c I've looked at we in the end didn't
> decide to decompose it anyway (perhaps some other non-subreg use).
> 
> 2018-05-29  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR target/85945
> 	* lower-subreg.c (find_decomposable_subregs): Don't decompose float
> 	subregs of multi-word pseudos unless the float mode has word size.
> 
> 	* gcc.c-torture/compile/pr85945.c: New test.
I thought we had a target macro which told us when it was safe to do
this kind of thing.  But I can't seem to find it.  It probably wouldn't
be the solution here since we're trying to avoid an ICE within the
lowering pass.  But it might point to other concerns in this space.

Anyway, the patch is fine.  I'm comfortable returning to the question
WRT vector modes as a distinct issue in the future after you gather some
data.

jeff



More information about the Gcc-patches mailing list