aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/riscv
diff options
context:
space:
mode:
authorxuli <xuli1@eswincomputing.com>2024-10-28 04:41:09 +0000
committerxuli <xuli1@eswincomputing.com>2024-10-28 06:58:48 +0000
commit75caa17f5cb4e414919baff0435300b549a76eca (patch)
tree929850e9ac48c96324722b4157f5a3699df64223 /gcc/config/riscv
parentf1823d8037e355cd755087e695051d190ffe755e (diff)
downloadgcc-75caa17f5cb4e414919baff0435300b549a76eca.zip
gcc-75caa17f5cb4e414919baff0435300b549a76eca.tar.gz
gcc-75caa17f5cb4e414919baff0435300b549a76eca.tar.bz2
RISC-V:Bugfix for vlmul_ext and vlmul_trunc with NULL return value[pr117286]
This patch fixes following ICE: test.c: In function 'func': test.c:37:24: internal compiler error: Segmentation fault 37 | vfloat16mf2_t vc = __riscv_vlmul_trunc_v_f16m1_f16mf2(vb); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The root cause is that vlmul_trunc has a null return value. gimple_call <__riscv_vlmul_trunc_v_f16m1_f16mf2, NULL, vb_13> ^^^ Passed the rv64gcv_zvfh regression test. Singed-off-by: Li Xu <xuli1@eswincomputing.com> PR target/117286 gcc/ChangeLog: * config/riscv/riscv-vector-builtins-bases.cc: Do not expand NULL return. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/pr117286.c: New test.
Diffstat (limited to 'gcc/config/riscv')
-rw-r--r--gcc/config/riscv/riscv-vector-builtins-bases.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/config/riscv/riscv-vector-builtins-bases.cc b/gcc/config/riscv/riscv-vector-builtins-bases.cc
index fcc1bf9..b8c337f 100644
--- a/gcc/config/riscv/riscv-vector-builtins-bases.cc
+++ b/gcc/config/riscv/riscv-vector-builtins-bases.cc
@@ -1753,6 +1753,8 @@ public:
rtx expand (function_expander &e) const override
{
+ if (!e.target)
+ return NULL_RTX;
tree arg = CALL_EXPR_ARG (e.exp, 0);
rtx src = expand_normal (arg);
emit_move_insn (gen_lowpart (e.vector_mode (), e.target), src);
@@ -1767,6 +1769,8 @@ public:
rtx expand (function_expander &e) const override
{
+ if (!e.target)
+ return NULL_RTX;
rtx src = expand_normal (CALL_EXPR_ARG (e.exp, 0));
emit_move_insn (e.target, gen_lowpart (GET_MODE (e.target), src));
return e.target;