aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ubsan/pr120837.c
diff options
context:
space:
mode:
authorRobin Dapp <rdapp@ventanamicro.com>2025-08-07 09:26:09 +0200
committerRobin Dapp <rdapp@ventanamicro.com>2025-09-02 17:24:40 +0200
commit9bbf0996bfcd249ef474a3da19831f66a8714319 (patch)
tree9042b538a29f63f6ebf85822767337de9e6f5303 /gcc/testsuite/gcc.dg/ubsan/pr120837.c
parentf957d352bd6f240829226405e9be7960071d1b9c (diff)
downloadgcc-master.zip
gcc-master.tar.gz
gcc-master.tar.bz2
RISC-V: Fix is_vlmax_len_p and use for strided ops.HEADtrunkmaster
This patch changes is_vlmax_len_p to handle VLS modes properly. Before we would check if len == GET_MODE_NUNITS (mode). This works vor VLA modes but not necessarily for VLS modes. We regularly have e.g. small VLS modes where LEN equals their number of units but which do not span a full vector. Therefore now check if len * GET_MODE_UNIT_SIZE (mode) equals BYTES_PER_RISCV_VECTOR * TARGET_MAX_LMUL. Changing this uncovered an oversight in avlprop where we used GET_MODE_NUNITS as AVL when GET_MODE_NUNITS / NF would be correct. The testsuite is unchanged. I didn't bother to add a dedicated test because we would have seen the fallout any way once the gather patch lands. gcc/ChangeLog: * config/riscv/riscv-v.cc (is_vlmax_len_p): Properly handle VLS modes. (imm_avl_p): Fix VLS length check. (expand_strided_load): Use is_vlmax_len_p. (expand_strided_store): Ditto. * config/riscv/riscv-avlprop.cc (pass_avlprop::execute): Use GET_MODE_NUNITS / NF as avl.
Diffstat (limited to 'gcc/testsuite/gcc.dg/ubsan/pr120837.c')
0 files changed, 0 insertions, 0 deletions