From: Robin Dapp Date: Wed, 5 Jul 2023 12:42:21 +0000 (+0200) Subject: RISC-V: Change truncate to float_truncate in narrowing patterns. X-Git-Tag: basepoints/gcc-15~7819 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=429905d809bbf2398bf666d65322b87ac7381e43;p=thirdparty%2Fgcc.git RISC-V: Change truncate to float_truncate in narrowing patterns. This fixes a bug in the autovect FP narrowing patterns which resulted in a combine ICE. It would try to e.g. simplify a unary operation by simplify_const_unary_operation which obviously expects a float_truncate and not a truncate for a floating-point mode. gcc/ChangeLog: * config/riscv/autovec.md: Use float_truncate. --- diff --git a/gcc/config/riscv/autovec.md b/gcc/config/riscv/autovec.md index 4ab0e9f99eba..0fc2bf5186fb 100644 --- a/gcc/config/riscv/autovec.md +++ b/gcc/config/riscv/autovec.md @@ -473,7 +473,7 @@ ;; ------------------------------------------------------------------------- (define_insn_and_split "trunc2" [(set (match_operand: 0 "register_operand" "=vr") - (truncate: + (float_truncate: (match_operand:VWEXTF_ZVFHMIN 1 "register_operand" " vr")))] "TARGET_VECTOR && can_create_pseudo_p ()" "#" @@ -493,7 +493,7 @@ ;; ------------------------------------------------------------------------- (define_expand "trunc2" [(set (match_operand: 0 "register_operand") - (truncate: + (float_truncate: (match_operand:VQEXTF 1 "register_operand")))] "TARGET_VECTOR && (TARGET_ZVFHMIN || TARGET_ZVFH)" {