]> git.ipfire.org Git - thirdparty/gcc.git/commit
rs6000: Fix up vspltis_shifted [PR102140]
authorJakub Jelinek <jakub@redhat.com>
Tue, 8 Feb 2022 19:14:30 +0000 (20:14 +0100)
committerJakub Jelinek <jakub@redhat.com>
Wed, 11 May 2022 05:58:37 +0000 (07:58 +0200)
commit8c9f4bafe532508904d4d16379d6882ddedac367
treeb85f5f295158ac8b4d6ca7e2bf566addc42346fd
parentb7e9d466fcf2f7c44ae31a2b308b0f1e406d1b9f
rs6000: Fix up vspltis_shifted [PR102140]

The following testcase ICEs, because
(const_vector:V4SI [
                (const_int 0 [0]) repeated x3
                (const_int -2147483648 [0xffffffff80000000])
            ])
is recognized as valid easy_vector_constant in between split1 pass and
end of RA.
The problem is that such constants need to be split, and the only
splitter for that is:
(define_split
  [(set (match_operand:VM 0 "altivec_register_operand")
        (match_operand:VM 1 "easy_vector_constant_vsldoi"))]
  "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode) && can_create_pseudo_p ()"
There is only a single splitting pass before RA, so after that finishes,
if something gets matched in between that and end of RA (after that
can_create_pseudo_p () would be no longer true), it will never be
successfully split and we ICE at final.cc time or earlier.

The i386 backend (and a few others) already use
(cfun->curr_properties & PROP_rtl_split_insns)
as a test for split1 pass finished, so that some insns that should be split
during split1 and shouldn't be matched afterwards are properly guarded.

So, the following patch does that for vspltis_shifted too.

2022-02-08  Jakub Jelinek  <jakub@redhat.com>

PR target/102140
* config/rs6000/rs6000.c (vspltis_shifted): Return false also if
split1 pass has finished already.

* gcc.dg/pr102140.c: New test.

(cherry picked from commit 0c3e491a4e5ae74bfbed6d167d403d262b5a4adc)
gcc/config/rs6000/rs6000.c
gcc/testsuite/gcc.dg/pr102140.c [new file with mode: 0644]