Committed. Thanks Juzhe!

I had to adjust the changelog's PR formatting to get the pre-commit hooks to accept it.
Here's the committed patch:

From f446cf5d58568e406cc81f434a63b3045942e9a9 Mon Sep 17 00:00:00 2001
From: Patrick O'Neill <patr...@rivosinc.com>
Date: Sat, 30 Sep 2023 15:50:11 -0700
Subject: [PATCH] RISC-V: Use safe_grow_cleared for vector info [PR111649]

Resolves a riscv*-*-* bootstrap failure due to a newly-turned-on assert.

2023-09-30  Jakub Jelinek <ja...@redhat.com>

gcc/ChangeLog:

    PR target/111649

    * config/riscv/riscv-vsetvl.cc (vector_infos_manager::vector_infos_manager):
    Replace safe_grow with safe_grow_cleared.
---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111649

Fix authored by Jakub Jelinek.

Tested for regressions using multilib riscv glibc rv32gcv, rv64gcv
---
 gcc/config/riscv/riscv-vsetvl.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc
index af8c31d873c..4b06d93e7f9 100644
--- a/gcc/config/riscv/riscv-vsetvl.cc
+++ b/gcc/config/riscv/riscv-vsetvl.cc
@@ -2417,8 +2417,8 @@ vector_infos_manager::vector_infos_manager ()
   vector_antin = nullptr;
   vector_antout = nullptr;
   vector_earliest = nullptr;
-  vector_insn_infos.safe_grow (get_max_uid ());
-  vector_block_infos.safe_grow (last_basic_block_for_fn (cfun));
+  vector_insn_infos.safe_grow_cleared (get_max_uid ());
+  vector_block_infos.safe_grow_cleared (last_basic_block_for_fn (cfun));
   if (!optimize)
     {
       basic_block cfg_bb;
--
2.34.1

On 9/30/23 16:03, 钟居哲 wrote:
LGTM.

------------------------------------------------------------------------
juzhe.zh...@rivai.ai

    *From:* Patrick O'Neill <mailto:patr...@rivosinc.com>
    *Date:* 2023-10-01 07:00
    *To:* gcc-patches <mailto:gcc-patches@gcc.gnu.org>; juzhe.zhong
    <mailto:juzhe.zh...@rivai.ai>
    *CC:* jakub <mailto:ja...@redhat.com>; pinskia
    <mailto:pins...@gcc.gnu.org>; JeffreyALaw
    <mailto:jeffreya...@gmail.com>; gnu-toolchain
    <mailto:gnu-toolch...@rivosinc.com>; Patrick O'Neill
    <mailto:patr...@rivosinc.com>
    *Subject:* [PATCH] RISC-V: Use safe_grow_cleared for vector info
    [PR111469]
    Resolves a riscv*-*-* bootstrap failure due to a newly-turned-on
    assert.
    2023-09-30  Jakub Jelinek <ja...@redhat.com>
    PR target/111649
    gcc/ChangeLog:
    * config/riscv/riscv-vsetvl.cc
    (vector_infos_manager::vector_infos_manager):
    Replace safe_grow with safe_grow_cleared.
    ---
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111649
    Fix authored by Jakub Jelinek.
    Tested for regressions using multilib riscv glibc rv32gcv, rv64gcv
    ---
    gcc/config/riscv/riscv-vsetvl.cc | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)
    diff --git a/gcc/config/riscv/riscv-vsetvl.cc
    b/gcc/config/riscv/riscv-vsetvl.cc
    index af8c31d873c..4b06d93e7f9 100644
    --- a/gcc/config/riscv/riscv-vsetvl.cc
    +++ b/gcc/config/riscv/riscv-vsetvl.cc
    @@ -2417,8 +2417,8 @@ vector_infos_manager::vector_infos_manager ()
       vector_antin = nullptr;
       vector_antout = nullptr;
       vector_earliest = nullptr;
    -  vector_insn_infos.safe_grow (get_max_uid ());
    -  vector_block_infos.safe_grow (last_basic_block_for_fn (cfun));
    +  vector_insn_infos.safe_grow_cleared (get_max_uid ());
    +  vector_block_infos.safe_grow_cleared (last_basic_block_for_fn
    (cfun));
       if (!optimize)
         {
           basic_block cfg_bb;
    --
    2.34.1

Reply via email to