[Bug target/94052] Paradoxical subregs out of expand causes ICE with multi register modes at -O2 or higher

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Mar 24 14:54:34 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94052

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Tamar Christina
<tnfchris@gcc.gnu.org>:

https://gcc.gnu.org/g:8fa2081ca6288853f3b8ceecd7d57ddf5dba5e7a

commit r9-8412-g8fa2081ca6288853f3b8ceecd7d57ddf5dba5e7a
Author: Tamar Christina <tamar.christina@arm.com>
Date:   Tue Mar 24 12:36:19 2020 +0000

    AArch64: Break apart paradoxical subregs for VSTRUCT writes (PR
target/94052)

    This works around an ICE in reload where from expand we get the following
RTL
    generated for VSTRUCT mode writes:

    (insn 446 354 445 2 (set (reg:CI 383)
     (subreg:CI (reg:V4SI 291) 0)) "small.i":146:22 3408 {*aarch64_movci}
     (nil))

    This sequence is trying to say two things:

    1) liveliness: It's trying to say that eventually the whole CI reg will be
                   written to. It does this by generating the paradoxical
subreg.
    2) write data: It's trying to in the same instruction also write the V4SI
mode
                   component at offset 0 in the CI reg.

    This patch fixes it by in the backend when we see such a paradoxical
    construction breaking it apart and issuing a clobber to correct the
liveliness
    information and then emitting a normal subreg write for the component that
the
    paradoxical subreg was trying to write to.

    Concretely we generate this:

    (insn 42 41 43 (clobber (reg/v:CI 122 [ diD.5226 ])) "small.i":121:23 -1
         (nil))

    (insn 43 42 44 (set (subreg:V4SI (reg/v:CI 122 [ diD.5226 ]) 0)
            (reg:V4SI 136)) "small.i":121:23 -1
         (nil))

    gcc/ChangeLog:

            PR target/94052
            * config/aarch64/aarch64-simd.md (mov<mode>): Remove paradoxical
            subregs of VSTRUCT modes.

    gcc/testsuite/ChangeLog:

            PR target/94052
            * g++.target/aarch64/pr94052.C: New test.


More information about the Gcc-bugs mailing list