public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "juzhe.zhong@rivai.ai" <juzhe.zhong@rivai.ai>
To: demin.han <demin.han@starfivetech.com>,
	 gcc-patches <gcc-patches@gcc.gnu.org>
Cc: kito.cheng <kito.cheng@gmail.com>,  pan2.li <pan2.li@intel.com>,
	 jeffreyalaw <jeffreyalaw@gmail.com>
Subject: 回复: RE: [PATCH] RISC-V: Fix ICE in riscv vector costs
Date: Thu, 7 Mar 2024 15:52:04 +0800	[thread overview]
Message-ID: <EA7C6D959957F8BA+2024030715520411065312@rivai.ai> (raw)
In-Reply-To: <ZQ0PR01MB1063E24CF4FA3F761D5CCEDB8520A@ZQ0PR01MB1063.CHNPR01.prod.partner.outlook.cn>

[-- Attachment #1: Type: text/plain, Size: 2232 bytes --]

I suggest open an PR with a PR id.



juzhe.zhong@rivai.ai
 
发件人: Demin Han
发送时间: 2024-03-07 15:39
收件人: juzhe.zhong@rivai.ai; gcc-patches
抄送: kito.cheng; pan2.li; jeffreyalaw
主题: RE: [PATCH] RISC-V: Fix ICE in riscv vector costs
OK.
Which is better for testcase name?
1.      ice-biggestmode.c or
2.      Report a bug and name the testcase with PR id
 
From: juzhe.zhong@rivai.ai <juzhe.zhong@rivai.ai> 
Sent: 2024年3月7日 15:20
To: Demin Han <demin.han@starfivetech.com>; gcc-patches <gcc-patches@gcc.gnu.org>
Cc: kito.cheng <kito.cheng@gmail.com>; pan2.li <pan2.li@intel.com>; jeffreyalaw <jeffreyalaw@gmail.com>
Subject: Re: [PATCH] RISC-V: Fix ICE in riscv vector costs
 
Could you plz add testcase ? I just noticed you didn't append a testcase (jpeg) in this patch.
 


juzhe.zhong@rivai.ai
 
From: demin.han
Date: 2024-03-07 13:54
To: gcc-patches
CC: juzhe.zhong; kito.cheng; pan2.li; jeffreyalaw
Subject: [PATCH] RISC-V: Fix ICE in riscv vector costs
The following code can result in ICE:
-march=rv64gcv_zba_zbb --param riscv-autovec-lmul=dynamic -O3
 
char *jpeg_difference7_input_buf;
void jpeg_difference7(int *diff_buf) {
  unsigned width;
  int samp, Rb;
  while (--width) {
    Rb = samp = *jpeg_difference7_input_buf;
    *diff_buf++ = -(int)(samp + (long)Rb >> 1);
  }
}
 
One biggest_mode update missed in one branch and trigger assertion fail.
gcc_assert (biggest_size >= mode_size);
 
Tested On RV64 and no regression.
 
gcc/ChangeLog:
 
* config/riscv/riscv-vector-costs.cc: Fix ICE
 
Signed-off-by: demin.han <demin.han@starfivetech.com>
---
gcc/config/riscv/riscv-vector-costs.cc | 2 ++
1 file changed, 2 insertions(+)
 
diff --git a/gcc/config/riscv/riscv-vector-costs.cc b/gcc/config/riscv/riscv-vector-costs.cc
index 7c9840df4e9..f13a1296b31 100644
--- a/gcc/config/riscv/riscv-vector-costs.cc
+++ b/gcc/config/riscv/riscv-vector-costs.cc
@@ -413,6 +413,8 @@ compute_local_live_ranges (
  auto *r = get_live_range (live_ranges, arg);
  gcc_assert (r);
  (*r).second = MAX (point, (*r).second);
+   biggest_mode = get_biggest_mode (
+     biggest_mode, TYPE_MODE (TREE_TYPE (arg)));
}
    }
  else
-- 
2.44.0
 
 

  reply	other threads:[~2024-03-07  7:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07  5:54 demin.han
2024-03-07  7:18 ` juzhe.zhong
2024-03-07  7:19 ` juzhe.zhong
2024-03-07  7:39   ` Demin Han
2024-03-07  7:52     ` juzhe.zhong [this message]
2024-03-07  8:32 ` [PATCH v2] " demin.han
2024-03-07  8:36   ` juzhe.zhong

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=EA7C6D959957F8BA+2024030715520411065312@rivai.ai \
    --to=juzhe.zhong@rivai.ai \
    --cc=demin.han@starfivetech.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    --cc=kito.cheng@gmail.com \
    --cc=pan2.li@intel.com \
    /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).