public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pan2.li at intel dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/114027] [14] RISC-V vector: miscompile at -O3
Date: Thu, 22 Feb 2024 07:43:07 +0000	[thread overview]
Message-ID: <bug-114027-4-LzSDJQDgDq@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114027-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114027

--- Comment #4 from Li Pan <pan2.li at intel dot com> ---
Just did some hacks from the riscv backend, which is to replace the expanding
code of reduc_smax_scal_<mode> to the reduc_xor_scal_<mode>.

diff --git a/gcc/config/riscv/autovec.md b/gcc/config/riscv/autovec.md
index 3b32369f68c..58424baabd7 100644
--- a/gcc/config/riscv/autovec.md
+++ b/gcc/config/riscv/autovec.md
@@ -2107,10 +2107,8 @@ (define_expand "reduc_smax_scal_<mode>"
    (match_operand:V_VLSI 1 "register_operand")]
   "TARGET_VECTOR"
 {
-  int prec = GET_MODE_PRECISION (<VEL>mode);
-  rtx min = immed_wide_int_const (wi::min_value (prec, SIGNED), <VEL>mode);
-  riscv_vector::expand_reduction (UNSPEC_REDUC_MAX, riscv_vector::REDUCE_OP,
-                                  operands, min);
+  riscv_vector::expand_reduction (UNSPEC_REDUC_XOR, riscv_vector::REDUCE_OP,
+                                  operands, CONST0_RTX (<VEL>mode));
   DONE;
 })

My idea would like to prove that the last standard name should be .REDUC_XOR.

Then the test (include the narrowed and the original one) can pass. That may
indicates we take .REDUC_MAX by mistake in somewhere. let me try to figure it
out.

  parent reply	other threads:[~2024-02-22  7:43 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-21  2:06 [Bug target/114027] New: " patrick at rivosinc dot com
2024-02-21  2:16 ` [Bug target/114027] " sjames at gcc dot gnu.org
2024-02-21  2:39 ` pinskia at gcc dot gnu.org
2024-02-22  6:39 ` pan2.li at intel dot com
2024-02-22  7:43 ` pan2.li at intel dot com [this message]
2024-02-22  8:57 ` rdapp at gcc dot gnu.org
2024-02-22  8:59 ` sjames at gcc dot gnu.org
2024-02-22  9:05 ` pinskia at gcc dot gnu.org
2024-02-22  9:06 ` rdapp at gcc dot gnu.org
2024-02-22  9:13 ` [Bug tree-optimization/114027] [14 Regression] " pinskia at gcc dot gnu.org
2024-02-22  9:20 ` [Bug tree-optimization/114027] [11/12/13/14 Regression] miscompile at `-O3 -fno-vect-cost-model -msse4.2` pinskia at gcc dot gnu.org
2024-02-22  9:26 ` jakub at gcc dot gnu.org
2024-02-22  9:37 ` rguenth at gcc dot gnu.org
2024-02-22  9:37 ` rguenth at gcc dot gnu.org
2024-02-22  9:37 ` rguenth at gcc dot gnu.org
2024-02-22  9:48 ` rguenth at gcc dot gnu.org
2024-02-22 12:14 ` cvs-commit at gcc dot gnu.org
2024-03-21 11:49 ` [Bug tree-optimization/114027] [11/12/13 " cvs-commit at gcc dot gnu.org
2024-03-26  7:39 ` [Bug tree-optimization/114027] [11/12 " chenglulu at loongson dot cn
2024-03-26  8:48 ` cvs-commit at gcc dot gnu.org
2024-03-26  8:48 ` cvs-commit at gcc dot gnu.org
2024-03-26  8:49 ` rguenth at gcc dot gnu.org
2024-05-16  9:56 ` cvs-commit at gcc dot gnu.org
2024-05-16  9:56 ` cvs-commit at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-114027-4-LzSDJQDgDq@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).