]> gcc.gnu.org Git - gcc.git/commit
genmodes: Update GET_MODE_MASK when changing NUNITS [PR98214]
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 12 Jan 2021 09:55:46 +0000 (09:55 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Tue, 12 Jan 2021 09:55:46 +0000 (09:55 +0000)
commit134d80cba22878bf1c1970191287e448e81c3658
treea6693f2749a46ac4baacec1a6c502ac887e70c4d
parentf36a9d20ecbc86eb13dae69020836850b125de0d
genmodes: Update GET_MODE_MASK when changing NUNITS [PR98214]

The static GET_MODE_MASKs for SVE vectors are based on the
static precisions, which in turn are based on 128-bit SVE.
The precisions are later updated based on -msve-vector-bits
(usually to become variable length), but the GET_MODE_MASK
stayed the same.  This caused combine to fold:

  (*_extract:DI (subreg:DI (reg:VNxMM R) 0) ...)

to zero because the extracted bits appeared to be insignificant.

gcc/
PR rtl-optimization/98214
* genmodes.c (emit_insn_modes_h): Emit a definition of CONST_MODE_MASK.
(emit_mode_mask): Treat mode_mask_array as non-constant if adj_nunits.
(emit_mode_adjustments): Update GET_MODE_MASK when updating
GET_MODE_NUNITS.
* machmode.h (mode_mask_array): Use CONST_MODE_MASK.

(cherry picked from commit 0411210fddbd3ec27c8dc1183f40f662712a2232)
gcc/genmodes.c
gcc/machmode.h
gcc/testsuite/gcc.target/aarch64/sve/pr98214.c [new file with mode: 0644]
This page took 0.400628 seconds and 5 git commands to generate.