https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115725
--- Comment #4 from Robin Dapp <rdapp at gcc dot gnu.org> --- Sorry, just got back from the RISC-V summit. IMHO, yes, it should be TU. We have the same thing for the not-element-0 case. I wonder why it doesn't fail with spike or qemu. Probably qemu doesn't do anything for TA and leaves everything as is. Hacking qemu to change that behavior might be worthwhile to uncover bugs. No idea about spike, though. Regardless, the following gives more reasonable code: diff --git a/gcc/config/riscv/autovec.md b/gcc/config/riscv/autovec.md index 1af50a46c4c..aa7dd526804 100644 --- a/gcc/config/riscv/autovec.md +++ b/gcc/config/riscv/autovec.md @@ -1341,7 +1341,8 @@ (define_expand "vec_set<mode>" { rtx ops[] = {operands[0], operands[0], operands[1]}; riscv_vector::emit_nonvlmax_insn (code_for_pred_broadcast (<MODE>mode), - riscv_vector::SCALAR_MOVE_MERGED_OP, ops, CONST1_RTX (Pmode)); + riscv_vector::SCALAR_MOVE_MERGED_OP_TU, + ops, CONST1_RTX (Pmode)); } else { diff --git a/gcc/config/riscv/riscv-protos.h b/gcc/config/riscv/riscv-protos.h index 39b723a590b..064aa082742 100644 --- a/gcc/config/riscv/riscv-protos.h +++ b/gcc/config/riscv/riscv-protos.h @@ -524,6 +524,10 @@ enum insn_type : unsigned int SCALAR_MOVE_MERGED_OP = HAS_DEST_P | HAS_MASK_P | USE_ONE_TRUE_MASK_P | HAS_MERGE_P | TDEFAULT_POLICY_P | MDEFAULT_POLICY_P | UNARY_OP_P, + + SCALAR_MOVE_MERGED_OP_TU = HAS_DEST_P | HAS_MASK_P | USE_ONE_TRUE_MASK_P + | HAS_MERGE_P | TU_POLICY_P | MDEFAULT_POLICY_P + | UNARY_OP_P, }; enum vlmul_type I suppose we don't need another test as it failed with the trunk test already?